Rate counter: Difference between revisions

Line 1,777:
x.report('array'){searchlist.each{|el| documents_a.any?{|d| d.id == el}} }
x.report('hash'){searchlist.each{|el| documents_h.has_key?(el)} }
end</lang>
 
</lang>
System: I7-6700HQ, 3.5 GHz, Linux Kernel 5.6.17, Ruby 2.7.1
Run as: $ crystal run longprimes.cr --release
{{Output}}
<pre>
user system total real
array 41 0.660000308848 0.000000037154 41 0.660000346002 ( 41 0.692570158290)
hash 0.020000005239 0.000000001036 0.020000006275 ( 0.013756002252)
➜ rosettacode
 
</pre>
 
Anonymous user