require 'benchmark/ips' N = 1_000_000 ARRAY = N.times.map { rand } Benchmark.ips do |x| x.report("reject") do arr = ARRAY.dup out = [] arr.reject! { _1 >= 0.5 } arr.each { out << _1 } end x.report("next") do arr = ARRAY.dup out = [] arr.each { next if _1 >= 0.5; out << _1 } end x.hold! 'temp_results' x.compare! end