public
Created

benchmark of .where(:_id.in => [...]) vs. multiple .find MongoDB/Mongoid queries

  • Download Gist
benchmark.bash
Shell
1 2 3 4
$ bex rails benchmarker 1000 "Artwork.where(:_id.in => [<...100 doc ids...>]).map(&:title)" "[<...100 doc ids...>].map{|id| Artwork.find(id) }.map(&:title)"
user system total real
#1 112.410000 1.470000 113.880000 (116.483996)
#2 151.740000 4.310000 156.050000 (166.557997)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.