Commit aa383ed
committed
feature #2821 [LiveComponent] Optimize
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[LiveComponent] Optimize `LiveComponentStack::getCurrentLiveComponent()`
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Using Reflection during runtime is costly. Here I suggest using static caching to prevent unnecessary usages of Reflection.
I've re-used reproducer from #2812, but with 50 rows (otherwise I can't create a Blackfire Profile), and it reduced the rendering time by 200ms, https://blackfire.io/profiles/compare/7aa62248-9332-40b3-b6fa-58756cb17232/graph
<img width="1341" alt="image" src="https://github.com/user-attachments/assets/d03148c5-521e-4501-937c-54d9e90ece73" />
**EDIT:** see #2821 (comment)
Commits
-------
a7920d4 [LiveComponent] Optimize `LiveComponentStack::getCurrentLiveComponent()`LiveComponentStack::getCurrentLiveComponent() (Kocal)1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
0 commit comments