Commit f30864e
authored
Cache the results of isCacheable calls to improve performance
This function call is relatively expensive when $elements has the full layout in it. Especially the PageCache module is calling this function a lot from the following places:
- Magento\PageCache\Model\Layout\LayoutPlugin
- Magento\PageCache\Observer\ProcessLayoutRenderElement
On my local machine I've seen the impact to be anywhere between 20-40 milliseconds, when the page has been loaded a few times to warm up cache (config, block, layout, etc...), but FPC is circumvented.
We could also opt to move this to the PageCache module, but I think it is ok to optimize this within the Layout class within the framework.1 parent a6933f3 commit f30864e
1 file changed
+18
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| |||
1138 | 1143 | | |
1139 | 1144 | | |
1140 | 1145 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1149 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
1150 | 1159 | | |
1151 | 1160 | | |
1152 | | - | |
| 1161 | + | |
1153 | 1162 | | |
1154 | 1163 | | |
1155 | 1164 | | |
| |||
0 commit comments