mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
debug: track expression parse time
This commit is contained in:
@@ -176,7 +176,12 @@ module Liquid
|
||||
# Example:
|
||||
# products == empty #=> products.empty?
|
||||
def [](expression)
|
||||
evaluate(Expression.parse(expression))
|
||||
start = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
|
||||
expression_parse_result = Expression.parse(expression)
|
||||
duration = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond) - start
|
||||
registers.static[:expression_parse_duration] ||= 0
|
||||
registers.static[:expression_parse_duration] += duration
|
||||
evaluate(expression_parse_result)
|
||||
end
|
||||
|
||||
def key?(key)
|
||||
|
||||
Reference in New Issue
Block a user