require 'benchmark' require 'active_support/all' { :test => :a }.to_json n = 50_000 Benchmark.bm do |benchmark| benchmark.report "hash tracking" do @trackings = [] 0.upto(n) do @trackings << { :elapsed => 0.23465723, :start => 1273651762534712, :stop => 1273658172365915, :duration => 23, :benchmark => "Some value", :url => "http://localhost:3000", :path => "/", :method => "GET", :status => 200 } end end benchmark.report "hash-to_json tracking" do @trackings = [] 0.upto(n) do @trackings << { :elapsed => 0.23465723, :start => 1273651762534712, :stop => 1273658172365915, :duration => 23, :benchmark => "Some value", :url => "http://localhost:3000", :path => "/", :method => "GET", :status => 200 }.to_json end end end