Sha256: 979c44e6ad8452b97f66e7cda95ddf67a272189ceb99f1ee8a975f6d3e459ddc

Contents?: true

Size: 470 Bytes

Versions: 59

Compression:

Stored size: 470 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__))

require 'slim'
require 'context'
require 'diffbench'

content = File.read(File.dirname(__FILE__) + '/view.slim')
engine = Slim::Engine.new
template = Slim::Template.new { content }
context = Context.new

DiffBench.bm do
  report("Parse") do
    2000.times { engine.call(content) }
  end
  report("Render") do
    100000.times { template.render(context) }
  end
end

Version data entries

59 entries across 59 versions & 5 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/benchmarks/run-diffbench.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/benchmarks/run-diffbench.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/benchmarks/run-diffbench.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/slim-4.1.0/benchmarks/run-diffbench.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/slim-4.1.0/benchmarks/run-diffbench.rb
slim-5.0.0 benchmarks/run-diffbench.rb
slim-4.1.0 benchmarks/run-diffbench.rb
slim-4.0.1 benchmarks/run-diffbench.rb
slim-4.0.0 benchmarks/run-diffbench.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
slim-3.0.9 benchmarks/run-diffbench.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/slim-3.0.7/benchmarks/run-diffbench.rb