Skip to content

Instantly share code, notes, and snippets.

@jaimerson
Created August 1, 2016 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaimerson/e96ac2ef5285666a1df7a0fd50759300 to your computer and use it in GitHub Desktop.
Save jaimerson/e96ac2ef5285666a1df7a0fd50759300 to your computer and use it in GitHub Desktop.
Benchmark of naive vs AR+SQL
Benchmark.bm do |x|
x.report(:naive) { BikesReport::NaiveApproach.new.to_a }
x.report(:ar_and_sql) { BikesReport::ActiveRecordSqlApproach.new.to_a }
end
# user system total real
# 9.600000 0.790000 10.390000 ( 10.639153)
# 0.020000 0.000000 0.020000 ( 0.137610)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment