Sha256: 6fa573a7109b867ecda4cd858ee187c0e3a3007def79c8be2d0a88ccae1662ed
Contents?: true
Size: 802 Bytes
Versions: 4
Compression:
Stored size: 802 Bytes
Contents
require 'lib/bonsai' require 'benchmark' Bonsai.root_dir = File.dirname(__FILE__) + "/../spec/support" Bonsai.config = { :enable_logging => false } page = Bonsai::Page.find("about-us/history") Benchmark.bm do |b| b.report "all" do 1_000.times do Bonsai::Page.all end end b.report "find" do 10_000.times do Bonsai::Page.find("about-us/history") end end b.report "parent" do 10_000.times do page.parent end end b.report "children" do 10_000.times do page.children end end b.report "siblings" do 10_000.times do page.siblings end end b.report "ancestors" do 10_000.times do page.ancestors end end b.report "rendering" do 1000.times do page.render end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
bonsai-1.3.0 | benchmark/associations.rb |
bonsai-1.2.0 | benchmark/associations.rb |
bonsai-1.1.6 | benchmark/associations.rb |
bonsai-1.1.5 | benchmark/associations.rb |