Skip to content

Instantly share code, notes, and snippets.

@huoxito
Last active August 29, 2015 14:10
Show Gist options
  • Save huoxito/2e0bc0b97420eb032329 to your computer and use it in GitHub Desktop.
Save huoxito/2e0bc0b97420eb032329 to your computer and use it in GitHub Desktop.

On current master:

$ ruby benchmarkips.rb
  0.200000   0.010000   0.210000 (  0.248978)

$ ruby benchmarkips.rb
  0.200000   0.010000   0.210000 (  0.249966)

$ ruby benchmarkips.rb
  0.200000   0.010000   0.210000 (  0.250471)

$ ruby benchmarkips.rb
  0.200000   0.020000   0.220000 (  0.253052)

$ ruby benchmarkips.rb
  0.200000   0.010000   0.210000 (  0.251087)

On checkout-queries-review:

$ ruby benchmarkips.rb
  0.180000   0.010000   0.190000 (  0.224924)

$ ruby benchmarkips.rb
  0.190000   0.010000   0.200000 (  0.234370)

$ ruby benchmarkips.rb
  0.180000   0.020000   0.200000 (  0.228028)

$ ruby benchmarkips.rb
  0.180000   0.010000   0.190000 (  0.222270)

$ ruby benchmarkips.rb
  0.190000   0.010000   0.200000 (  0.228578)

Script:

require 'benchmark'
require 'benchmark/ips'

require File.expand_path("../config/environment", __FILE__)

module Spree
  order = Spree::Order.create email: 'spree@example.com'
  variant = Spree::Variant.find(2)

  puts Benchmark.measure { order.contents.add variant }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment