spec/functional/pool_spec.rb in picky-4.14.0 vs spec/functional/pool_spec.rb in picky-4.15.0

- old
+ new

@@ -26,11 +26,11 @@ end index end let(:search) { Picky::Search.new data } - # TODO Study what the problem is. + # TODO Why are both versions almost equally fast? # context 'without pool' do it 'runs the GC more' do # Quickly check if the pool is removed. # @@ -38,18 +38,18 @@ try = search query = 'abracadabra mirgel' gc_runs_of do amount.times { try.search query } - end.should <= 13 + end.should >= 10 end it 'is less (?) performant' do try = search query = 'abracadabra mirgel' performance_of do amount.times { try.search query } - end.should <= 0.42 + end.should >= 0.15 end end context 'with pool' do before(:each) do Picky::Pool.install @@ -65,18 +65,21 @@ fail 'object pool not installed' unless Picky::Query::Token.respond_to? :release_all try = search query = 'abracadabra mirgel' gc_runs_of do - amount.times { try.search query; Picky::Pool.release_all } + amount.times do + try.search query + Picky::Pool.release_all + end end.should <= 1 # Definitely less GC runs. end it 'is more (?) performant' do try = search query = 'abracadabra mirgel' performance_of do amount.times { try.search query } - end.should <= 0.42 + end.should <= 0.2 end end end \ No newline at end of file