File: bench_SrV.rb

package info (click to toggle)
ruby-ffi 1.17.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: ruby: 9,446; ansic: 7,713; xml: 151; sh: 51; makefile: 14
file content (18 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require_relative 'bench_helper'

module BenchSrV
  module LibTest
    extend FFI::Library
    ffi_lib LIBTEST_PATH
    attach_function :bench_S_v, [ :string ], :void
  end

  puts "Benchmark [ :string ], :void performance, #{ITER}x calls"

  s = 'a' * 1000
  10.times {
    puts Benchmark.measure {
      ITER.times { LibTest.bench_S_v(s) }
    }
  }
end