profiling newb

This is a discussion on profiling newb within the PHP General forums, part of the PHP Programming Forums category; all, i am just getting my feet wet w/ profiling. its nice to see i can invoke a page from ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-11-2007
Nathan Nobbe
 
Posts: n/a
Default profiling newb

all,

i am just getting my feet wet w/ profiling.
its nice to see i can invoke a page from the browser then
see an analysis in kcachegrind using xdebug to generate the data.
however, im curious about 'finding the weak spots in an application'.
say for instance i arrive at a new location as a consultant or w/e;
point is assume a totally foreign codebase that needs to be
optimized. theoretically 'profiling' would be a way to analyze the
application and determine where the slow points are, which methods
are getting called repeatedly and so forth. then those areas could be
analyzed for potential gains.
it seems to me though, that since generating a series of cache files
is a manual process and the analysis a manual process it would take
a long time just to profile an application. so someone familiar with
said application could point out the slow spots much more quickly
than a person using a profiling tool.
is there a tool that can analyze a large number of cache files and give
some sort of comprehensive report? it seems very natural to have cache
files get generated in a pre-production site for analysis. if they could be
sent through something that generated a comprehensive report that would
really reduce profiling time rather than having to look through them one at
a time.
or am i missing something because im new to profiling ?

thanks,

-nathan

Reply With Quote
  #2 (permalink)  
Old 09-11-2007
Chris
 
Posts: n/a
Default Re: [PHP] profiling newb

Nathan Nobbe wrote:
> all,
>
> i am just getting my feet wet w/ profiling.
> its nice to see i can invoke a page from the browser then
> see an analysis in kcachegrind using xdebug to generate the data.
> however, im curious about 'finding the weak spots in an application'.
> say for instance i arrive at a new location as a consultant or w/e;
> point is assume a totally foreign codebase that needs to be
> optimized. theoretically 'profiling' would be a way to analyze the
> application and determine where the slow points are, which methods
> are getting called repeatedly and so forth. then those areas could be
> analyzed for potential gains.
> it seems to me though, that since generating a series of cache files
> is a manual process and the analysis a manual process it would take
> a long time just to profile an application. so someone familiar with
> said application could point out the slow spots much more quickly
> than a person using a profiling tool.
> is there a tool that can analyze a large number of cache files and give
> some sort of comprehensive report? it seems very natural to have cache
> files get generated in a pre-production site for analysis. if they could be
> sent through something that generated a comprehensive report that would
> really reduce profiling time rather than having to look through them one at
> a time.


While code optimization/checking is definitely something that needs
attention, personally I'd look at the database side of things first.

If you're using a database wrapper of some sort, see if there are any
logging options (ideally one that logs both the query & the time it took
to run). Missing indexes or bad queries will slow things down a lot
quicker than changing a foreach loop to a while loop.

Alternatively make sure your database has logging enabled and look at
that instead (hopefully in a limited environment so you don't have 50
people hitting different apps all at the same time).

I'm not sure if xdebug can take that sort of stuff into account when it
generates the times.

After that, definitely look at the code. Write a script to summarize the
xdebug output files and generate a report (I'd do it in perl myself but
YMMV).

--
Postgresql & php tutorials
http://www.designmagick.com/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0