Profiler HTML output exceeds browser rendering capacity on complex pages
0 reputation · 20 Jun 2022, 08:11 UTC
Context
Magento 2's built-in profiler (Magento\Framework\Profiler) can be enabled via bin/magento dev:profiler:enable html_file to generate flame-graph HTML reports in var/profiler.*.html. The profiler captures timer IDs, elapsed time, memory usage, and call counts for each instrumented code block.
Problem
On complex pages (e.g., category listings with layered navigation, checkout with many quote items), the generated HTML file frequently exceeds 50 MB. Browsers struggle to parse and render such large single-page flame graphs, resulting in frozen tabs, excessive memory consumption, or outright crashes before analysis can begin. The profiler does not implement pagination, streaming, or incremental rendering for the HTML driver.
Constraints
- CSV output remains parseable at any size but lacks the visual flame-graph view.
- Custom drivers can stream to external systems (Blackfire, Tideways), yet the built-in drivers provide no such integration.
- Magento recommends against enabling the profiler in production due to overhead and potential exposure of internal timing data, but no enforced guard exists.
What configuration or workflow allows analyzing bottlenecks on heavy pages without hitting the browser rendering limit? Is there a supported method to split or stream the HTML profiler output? Can the CSV data be reliably transformed into a navigable flame graph using offline tooling?