facebook/xhprof
XHProf is a lightweight PHP function-level profiler for measuring performance and memory usage. Collects call graphs, timing, and resource metrics to help find bottlenecks in production or development, with data suitable for analysis and visualization.
Xhprof is a PHP extension + UI bundle for profiling PHP applications at function-level granularity. Since it's an extension, the first step is installing the xhprof PECL package (e.g., pecl install xhprof) and enabling it in php.ini (extension=xhprof.so on Linux). Once installed, you trigger profiling by calling xhprof_enable() at the start of your script (e.g., early in the front controller or middleware), then xhprof_disable() at the end, which returns raw profiling data. Pass that data to the built-in HTML UI (usually xhprof_html/index.php) for visualization. For Laravel, the simplest first use case is wrapping a single route’s execution to diagnose a slow endpoint.
xhprof_enable() / xhprof_disable() for one-off diagnostics.X-Profile: 1), using config flags to avoid performance impact on production users.xhprof_save_run() function to write profiling runs to a directory, then browse via the UI or integrate with systems like Blackfire or custom dashboards.xhprof_enable() inside artisan commands to profile queue workers or exports./tmp/xhprof by default) with filenames like run_id.xhprof. Use xhprof_save_run() and ensure the web server can read that directory.auto_prepend_file or auto_append_file in php.ini aren’t interfering with manual profiling calls—especially in CLI or FPM contexts. Use xhprof_disable() only once per enable() call to avoid segfaults.How can I help you explore Laravel packages today?