Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* before user system total real filled object / string 0.990000 0.000000 0.990000 ( 0.981791) filled object / numeric 0.930000 0.000000 0.930000 ( 0.928791) empty array / string 0.160000 0.010000 0.170000 ( 0.095161) empty array / numeric 0.010000 0.000000 0.010000 ( 0.015316) * after user system total real filled object / string 0.060000 0.000000 0.060000 ( 0.057018) filled object / numeric 0.050000 0.000000 0.050000 ( 0.051273) empty array / string 0.080000 0.000000 0.080000 ( 0.045073) empty array / numeric 0.020000 0.000000 0.020000 ( 0.014007) {{{ require 'benchmark' Benchmark.bm(25) do |x| ary = ['obj'] * 10000 x.report "filled object / string" do 1000.times do ary.unshift("a") end end ary = ['obj'] * 10000 x.report "filled object / numeric" do 1000.times do ary.unshift(0) end end ary = Array.new(10000) x.report "empty array / string" do 1000.times do ary.unshift("a") end end ary = Array.new(10000) x.report "empty array / numeric" do 1000.times do ary.unshift(0) end end end }}}
- Loading branch information