php-liquid
php-liquid copied to clipboard
Improve performance
I have identified three main bottlenecks when profiling the code with xdebug:
array_shift(): The array of tokens ended up being renumbered on each iteration. So we instead set consumed tokens tonull.mb_substr(): Using mutltibyte here is unnecessary and overkill, when we can just operate directly on the string.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.
+1
Can you merge with the master branch please?
I would also appreciate if you could avoid force pushes: it prevents me from reviewing changes added since last review, and I have to effectively begin from scratch. Not great.
I think I have to return to Liquid::$config again.