fast-path render for filter-less variables: skip render method overhead

This commit is contained in:
Tobi Lutke
2026-03-11 07:33:18 -04:00
parent 6bcc2936a2
commit f8b015646a
+6 -1
View File
@@ -188,7 +188,12 @@ module Liquid
end
def render_to_output_buffer(context, output)
obj = render(context)
# Fast path: no filters and no global filter
if @filters.empty? && context.global_filter.nil?
obj = context.evaluate(@name)
else
obj = render(context)
end
render_obj_to_output(obj, output)
output
end