public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9
ruby bench_negate.rb
performing 30 iterations...
Rehearsal -------------------------------------------
Devil 0.110000 0.090000 0.200000 ( 0.264404)
RMagick 0.250000 0.230000 0.480000 ( 0.598489)
---------------------------------- total: 0.680000sec
 
user system total real
Devil 0.090000 0.080000 0.170000 ( 0.244527)
gistfile2.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
require 'rubygems'
require 'benchmark'
require 'RMagick'
require 'devil'
 
N = 30
puts "performing #{N} iterations..."
 
@dimg = Devil.load("texture.png")
@rimg = Magick::Image.read("texture.png").first
 
Benchmark.bmbm do |x|
x.report("Devil") {
N.times {
@dimg.dup.negative
}
}
 
x.report("RMagick") {
N.times {
@rimg.negate
}
}
end
 

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.