spec/specific/speed_spec.rb in picky-0.0.9 vs spec/specific/speed_spec.rb in picky-0.1.0

- old
+ new

@@ -1,9 +1,8 @@ require File.dirname(__FILE__) + '/../spec_helper' describe "Speccing Ruby for speed" do - describe "various versions for allocation id concatenating" do before(:each) do @allocs = [:hello, :speed, :test] @ids = { :hello => (1..100_000).to_a, @@ -20,35 +19,35 @@ it "should be fast" do Benchmark.realtime do @allocs.inject([]) do |total, alloc| total + @ids[alloc] end - end.should <= 0.0025 + end.should < 0.0025 end end describe "map and flatten!(1)" do it "should be fast" do Benchmark.realtime do @allocs.map { |alloc| @ids[alloc] }.flatten!(1) - end.should <= 0.02 + end.should < 0.02 end end describe "<< and flatten!(1)" do it "should be fast" do Benchmark.realtime do @allocs.inject([]) do |total, alloc| total << @ids[alloc] end.flatten!(1) - end.should <= 0.02 + end.should < 0.02 end end describe "<< and flatten!" do it "should be fast" do Benchmark.realtime do @allocs.inject([]) do |total, alloc| total << @ids[alloc] end.flatten! - end.should <= 0.02 + end.should < 0.02 end end end end \ No newline at end of file