Reduce MatchData allocations by matching in just the :initialize method and stash the result in instance_variables which is then used during the :render calls.
Reduce Array allocations by adding a check to the :lookup_variable method from Jekyll::LiquidExtensions. (Adding the check in Jekyll would limit its availability to just v4.1 and beyond. So optimize here directly.)
MatchData
allocations by matching in just the:initialize
method and stash the result in instance_variables which is then used during the:render
calls.Array
allocations by adding a check to the:lookup_variable
method fromJekyll::LiquidExtensions
. (Adding the check in Jekyll would limit its availability to just v4.1 and beyond. So optimize here directly.)