Move start of profiling to a Document#render_to_output_buffer patch

This commit is contained in:
Dylan Thacker-Smith
2020-12-09 10:04:34 -05:00
parent b3f132efd1
commit 896288eff1
3 changed files with 10 additions and 9 deletions
+8
View File
@@ -14,6 +14,14 @@ module Liquid
end
BlockBody.prepend(BlockBodyProfilingHook)
module DocumentProfilingHook
def render_to_output_buffer(context, output)
return super unless context.profiler
context.profiler.profile { super }
end
end
Document.prepend(DocumentProfilingHook)
module ContextProfilingHook
attr_accessor :profiler