NuSphere Forums Forum Index
NuSphere Forums
Reply to topic


Joined: 10 Aug 2007
Posts: 2
Reply with quote
Are there any further plans on improving the profiler output in PHPED?

When I'm profiling our large projects which usually end up with 50-100 mysql queries per generated page I cannot track down the "sources of evil" Smile

Why?

Usually we use a database abstraction layer which is in its simplest form a wrapper function to mysql_query(). Now, if I profile a PHP script which instantiates many components which all use this (singleton) abstraction the profiler luckily tells me that mysql_query (or better to say the wrapper function call) takes the longest time to execute. wow Smile database calls are in fact the bottleneck of most database driven websites.

What I need is a call stack tree for exactly these function calls, to see where the calls to the database wrapper originate from (component xy in our case).

Are there any plans on implementing this behavior into PHPED?

btw: keep on the great work on PHPED, love this product!
View user's profileFind all posts by chriswestSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7861
Reply with quote
Technically it's possible but it may dramatically slowdown the execution. After all, call stack won't help you with optimizing the DB queries. Our profiler did its good job for you and pointed out to the bottleneck. For now, what you need is to turn on mysql_slow.log. See log-slow-queries setting in my.cnf. You can specify for example to log all queries that take more than 1sec and optimize them... but it definitely falls beyoud PhpED tasks. At least at the moment! Smile

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Aug 2007
Posts: 2
Reply with quote
I've been using mysql-slow-log for a long time and I'm really happy with it about hunting down slow queries. I even added a call stack tree (from debug_backtrace) as mysql comment in front of each query, so it's possible to exactly see where the query originates - in a debugging environment of course Smile

The thing is - not all our queries can be fully optimized by setting / using indices etc. and I also like to work the other way round which means, I have a specific page and wonder why it's slow. Then I start the profiler for this specific page in order to see the bottlenecks. "tail -f"'ing the mysql-slow-log all the time and hoping not to miss the specific query is somewhat cumbersome if you know what I mean Smile

But well, I understand about the execution slowdown and I'm still happy with your profiler Smile
View user's profileFind all posts by chriswestSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7861
Reply with quote
Quote:
"tail -f"'ing the mysql-slow-log all the time and hoping not to miss the specific query

probably, slow-log can be turned on durding run-time for a specific connection, right? In this case you'd not miss your queries.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
plans on improving the profiler
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic