Sha256: 17ec06107ca709ce3ce550f979b2f4d466cc731591d1240cf1ef3c513d47a72f

Contents?: true

Size: 375 Bytes

Versions: 2

Compression:

Stored size: 375 Bytes

Contents

require 'convolver'
require 'narray'
require 'benchmark'

class Convolver2DBenchmark
  attr_reader :image, :kernel

  def initialize
    @image = NArray.float(640, 480).random
    @kernel = NArray.float(8, 8).random
  end
end

Benchmark.bm do |x|
  source = Convolver2DBenchmark.new
  x.report('kilo') { 1000.times { Convolver.convolve( source.image, source.kernel ) } }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
convolver-0.0.2 benchmarks/convolve_benchmark.rb
convolver-0.0.1 benchmarks/convolve_benchmark.rb