summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Meissner <wmeissner@gmail.com>2009-09-20 07:31:43 +1000
committerWayne Meissner <wmeissner@gmail.com>2009-09-20 07:31:43 +1000
commitb68622a79dda0fec07619751ddee7f8d12c95ef8 (patch)
treeda6d41e6bde2e32b179acd4af6ecde92f96c038c
parent7ef697dae234f6be5ca6c72f8b0cc2bf01ca62c6 (diff)
downloadffi-b68622a79dda0fec07619751ddee7f8d12c95ef8.tar.gz
Fixup 3 arg closure bench
-rw-r--r--bench/bench_closure_IIIrV.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/bench/bench_closure_IIIrV.rb b/bench/bench_closure_IIIrV.rb
index 0ef9b7c..b68c757 100644
--- a/bench/bench_closure_IIIrV.rb
+++ b/bench/bench_closure_IIIrV.rb
@@ -4,8 +4,8 @@ module LibTest
extend FFI::Library
ffi_lib LIBTEST_PATH
callback :closureIIIrV, [ :int, :int, :int ], :void
- attach_function :ffi_bench, :testClosureVrV, [ :closureVrV ], :void
- def self.rb_bench(&block); nil; end
+ attach_function :ffi_bench, :testClosureIIIrV, [ :closureIIIrV, :int, :int, :int ], :void
+ def self.rb_bench(&block); yield; end
end
unless RUBY_PLATFORM == "java" && JRUBY_VERSION < "1.3.0"
require 'dl'
@@ -24,15 +24,15 @@ end
puts "Benchmark [ ], :void closure block performance, #{ITER}x calls"
10.times {
puts Benchmark.measure {
- ITER.times { LibTest.ffi_bench { } }
+ ITER.times { LibTest.ffi_bench(1, 2, 3) { } }
}
}
-puts "Benchmark [ ], :void pre-allocated closure performance, #{ITER}x calls"
+puts "Benchmark [ ], :void pre-allocated function performance, #{ITER}x calls"
10.times {
- fn = FFI::Function.new(:void, []) {}
+ fn = FFI::Function.new(:void, [ :int, :int, :int ]) {}
puts Benchmark.measure {
- ITER.times { LibTest.ffi_bench fn }
+ ITER.times { LibTest.ffi_bench(fn, 1, 2, 3) }
}
}