Optimization is not usually done with tools, rather by examining your scripts, using profiling tool like xdebug, fining bottlenecks and changing your script manually. It’s a manual labor, not tool is smart enough to fix the poorly written script for you.
You should use a Profiler, XDebug has one and this one looks quick and nice:
Also in Google Chrome you can right click, Go to Inspect Element, Resources Tab, Enable Resource Tracking – and take a gander at that for a lot of other stuff too.
Without doing any coding, I’ve found step #1 to speed up a sluggish PHP application is to install a cache on the server like PHP APC. If the app is a huge beast of code, then at least it wont have to be compiled on every run.
Ofc, the problem could be with it’s database usage. If it run queries on large tables, then finding those queries and trying to make sure they have correct indexes could help
PHP APC is definately on the list of things to do, as well as memcache. For now I would like to focus on getting the code up to standard and optimized.
The application is database driven, and quite alot of db queries were written by Juniors who do not know alot about indexes and optimizing queries.
SO for ths php code I can use a profiler to help me determine where the code is taking to long, or using up to much memory, but is there a Mysql command or tool that I can use to determine which queries are taking the longest to execute?