You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lines 617 and 618 of the main wayfinder class(wayfinder.class.php) are inefficently getting a chunk twice, from my cachegrind outputs this can seriously affect Wayfinders performance, the lines :-
if ($this->modx->getChunk($tpl) != "") {
$template = $this->modx->getChunk($tpl);
can be easily optimised to get the chunk once, then test it, not twice as above.
The text was updated successfully, but these errors were encountered:
This is actually worse than you think, besides the above you don't want to use getChunk here as this calls the parser for every supplied chunk template, you just want to use a getObject for the chunk name and let Wayfinder handle the parsing.
reduces the cumulative page load time from cachegrind outputs from 2770ms to 1941ms, calls to the function processElementTags drop from 651 to 331, so we have a 30% better page load time. Timings from my local dev test site.
Lines 617 and 618 of the main wayfinder class(wayfinder.class.php) are inefficently getting a chunk twice, from my cachegrind outputs this can seriously affect Wayfinders performance, the lines :-
if ($this->modx->getChunk($tpl) != "") {
$template = $this->modx->getChunk($tpl);
can be easily optimised to get the chunk once, then test it, not twice as above.
The text was updated successfully, but these errors were encountered: