Skip to content

Instantly share code, notes, and snippets.

@banister
Created October 16, 2009 01:22
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 banister/211462 to your computer and use it in GitHub Desktop.
Save banister/211462 to your computer and use it in GitHub Desktop.
# NOTE: had to keep the number of iterations very very low or my system would grind to a halt
ruby bench_rotate.rb
performing 5 iterations...
user system total real
Devil 0.650000 0.110000 0.760000 ( 1.114564)
RMagick 5.360000 0.690000 6.050000 ( 7.602843)
require 'rubygems'
require 'benchmark'
require 'RMagick'
require 'devil'
N = 5
puts "performing #{N} iterations..."
@dimg = Devil.load("tank.png")
@rimg = Magick::Image.read("tank.png").first
Benchmark.bm do |x|
x.report("Devil") {
N.times {
@dimg.rotate(-45)
}
}
x.report("RMagick") {
N.times {
@rimg.rotate!(45)
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment