Repository navigation
Blade class component loop performance profile on 13.x with OPcache enabled #60344
Unanswered
mehmetcansahin
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context
I have been looking into Blade class component performance in loops on the current
13.xbranch, especially in the context of prior work and discussions around:@includeIsolateddirective for isolated Blade includes #58311The goal was not to open another speculative optimization PR, but to measure where the cost currently sits with OPcache enabled.
Environment
13.xSummary
The main finding is that
Component::data()/ public method reflection is measurable in isolated micro benchmarks, but it does not dominate full Blade render time.In full render benchmarks, the dominant cost appears to be compiled component view evaluation through
CompilerEngine::get()/View::render(), not:Factory::make()ComponentAttributeBagaloneFull Render Results
OPcache enabled, median:
Lifecycle Breakdown
OPcache enabled, median:
Component::resolve()Component::resolveView()cached inlineComponent::data()static componentComponent::data()with public methodswithAttributes()after dataFactory::make()onlyCompilerEngine::get()static viewCompilerEngine::get()attributes + slot viewView::render()static viewFactory::make()->render()static viewNotes
I initially looked at caching
ReflectionMethodmetadata insideComponent::data().That improved isolated micro benchmarks, but did not seem worthwhile as a core PR because full render improvements were inconsistent and usually below 5% with OPcache enabled.
That seems consistent with prior feedback on #51141 and #51152: once OPcache is enabled, file I/O or view instance caching style optimizations do not necessarily move the needle enough, and some approaches can introduce side effects.
Question
Given these results, is the intended direction:
@includeIsolatedfor hot loops / simple partials,I am happy to clean up and share the benchmark script if that would be useful.
All reactions