mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 02:40:41 -07:00
Avoid expr_markup byteslice when name is entire markup string (no whitespace, no filters)\n\nResult: {"status":"keep","combined_µs":4277,"parse_µs":3057,"render_µs":1220,"allocations":27026}
This commit is contained in:
@@ -151,8 +151,12 @@ module Liquid
|
|||||||
pos += 1
|
pos += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# Resolve the name expression
|
# Resolve the name expression — avoid byteslice when markup is already the name
|
||||||
expr_markup = markup.byteslice(name_start, name_end - name_start)
|
expr_markup = if name_start == 0 && name_end == len
|
||||||
|
markup # no whitespace, no filters — reuse the string
|
||||||
|
else
|
||||||
|
markup.byteslice(name_start, name_end - name_start)
|
||||||
|
end
|
||||||
cache = parse_context.expression_cache
|
cache = parse_context.expression_cache
|
||||||
ss = parse_context.string_scanner
|
ss = parse_context.string_scanner
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user