mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
14 lines
423 B
Ruby
14 lines
423 B
Ruby
require 'stackprof' rescue fail("install stackprof extension/gem")
|
|
require File.dirname(__FILE__) + '/theme_runner'
|
|
|
|
Liquid::Template.error_mode = ARGV.first.to_sym if ARGV.first
|
|
profiler = ThemeRunner.new
|
|
profiler.run
|
|
results = StackProf.run(mode: :cpu) do
|
|
100.times do
|
|
profiler.run
|
|
end
|
|
end
|
|
StackProf::Report.new(results).print_text(false, 20)
|
|
File.write(ENV['FILENAME'], Marshal.dump(results)) if ENV['FILENAME']
|