Compare commits

...

6 Commits

Author SHA1 Message Date
Umair Choudhary
9b06b71c34 added self time to profiler 2019-09-11 11:56:36 -04:00
Umair Choudhary
78cd06fb92 profiler 2019-09-10 15:38:54 -04:00
Umair Choudhary
ca6237cb33 render time attribute 2019-09-10 15:32:31 -04:00
Umair Choudhary
b9597b548c Add render time attr to profiler 2019-09-10 15:11:21 -04:00
Justin Li
806b2622da Switch back to Liquid-C master, since https://github.com/Shopify/liquid-c/pull/50 is merged 2019-09-04 15:12:51 -04:00
Mike Angell
c34f7c9b2c Merge pull request #1145 from Shopify/master-fixes
Render tag styling fixes
2019-09-04 14:25:38 +10:00
2 changed files with 14 additions and 2 deletions

View File

@@ -20,6 +20,6 @@ group :test do
gem 'rubocop-performance', require: false
platform :mri, :truffleruby do
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'liquid-tag'
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'master'
end
end

View File

@@ -44,7 +44,7 @@ module Liquid
include Enumerable
class Timing
attr_reader :code, :partial, :line_number, :children
attr_reader :code, :partial, :line_number, :children, :total_time, :self_time
def initialize(node, partial)
@code = node.respond_to?(:raw) ? node.raw : node
@@ -63,6 +63,18 @@ module Liquid
def finish
@end_time = Time.now
@total_time = @end_time - @start_time
if @children.size == 0
@self_time = @total_time
else
total_children_time = 0
@children.each do |child|
total_children_time += child.total_time
end
@self_time = @total_time - total_children_time
end
end
def render_time