Performance Profiler
Blockstudio includes a lightweight profiler that tracks render performance across the entire pipeline. It shows per-block timings, phase breakdowns, and cache hit rates.
Activation
Add ?blockstudio-perf to any frontend URL:
https://example.com/my-page/?blockstudio-perfOr enable it permanently in blockstudio.json:
{
"dev": {
"perf": true
}
}Or via filter:
add_filter('blockstudio/settings/dev/perf', '__return_true');The profiler only outputs data for logged-in users with edit_posts
capability.
Output
Debug panel
A fixed panel appears at the bottom of the page with a table showing every tracked metric, its duration, and call count.
Server-Timing headers
Timing data is also sent as Server-Timing HTTP headers, visible in the
browser DevTools Network tab under the "Timing" section. This works even
if the page HTML is cached by a CDN.
Tracked metrics
| Metric | Description |
|---|---|
total | Total Blockstudio processing time |
block-tags | Block tag parser (<bs:> and <block> replacement) |
assets | Asset discovery and injection |
tailwind | Tailwind CSS compilation |
phase:transform | Attribute transformation (per block render) |
phase:template | PHP/Twig template compilation (per block render) |
phase:twig | Twig-specific compilation (per block render) |
phase:components | Component replacement: InnerBlocks, RichText, useBlockProps (per block render) |
block:{name} | Individual block type render time with call count |
Render cache
Self-closing block tags (no inner content) are cached in memory during page rendering. When the same block with identical attributes appears multiple times, subsequent renders are served from cache. The cache is per-request and cleared after the page finishes rendering.
The profiler shows reduced render call counts when the cache is active, making it easy to verify caching is working.