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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php