forked from harrydeluxe/php-liquid
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I have identified three main bottlenecks when profiling the code with xdebug: 1. `array_shift()`: The array of tokens ended up being renumbered on each iteration. So we instead set consumed tokens to `null`. 2. `mb_substr()`: Using mutltibyte here is unnecessary and overkill, when we can just operate directly on the string. 3. `Liquid::get()`: This one surprised me, but due to the number of calls, here it is. Shave off more processing time by accessing the config array directly.
- Loading branch information
Showing
2 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters