Re:Phptop: Simple PHP ressource profiler, safe and useful fo...
by BafS on Thursday June 05, 2025 @10:37AM
(#44192126)
I can't praise SPX enough, it has saved my ass multiple times. The UI is great too.
Re:Phptop: Simple PHP ressource profiler, safe and useful fo...
by xd on Thursday June 05, 2025 @12:30PM
(#44193206)
From a quick skim of the repo it looks to be injecting phptop_hook.php into any call to a php file with auto_prepend_file in php.ini. phptop_hook.php generates some stats on how long it took the php file to process and stores this via error_log() which can then be queried with the perl script phptop.
Re:Phptop: Simple PHP ressource profiler, safe and useful fo...
by zerodeux on Thursday June 05, 2025 @12:42PM
(#44193313)
Author here.
"Query" does mean "HTTP request" in the summary. It's reported as "Hits" in the stats. Sorry for the incoherent wording ...
The SQL/wpdb support was added afterwards, and it shows because data is only collected but not used/displayed in the histograms.
Phptop is wayyy simpler and not even comparable to SPX, but you can install it in a few sec, use it 5min, uninstall it, and solve lots of common perf problem. That was my use case (it'as ancient code and I barely use it nowadays).
I see there's a wordpress-specific wpdb mechanism - though it just seems to report total time spent on queries, and the slowest query. Surely something like Query Monitor is a far better tool for that?
A tool that everyone should be aware of and using is php-spx - its absolutely glorious for performance profiling/investigation. xhgui is similar, but bulkier and (in my experience) less accurate/insightful.
https://github.com/NoiseByNorthwest/php-spx