Sha256: 1cc3970e1e0d71bda98306cc424b4cf2817f912431b4f3648e917dafb1eedc33

Contents?: true

Size: 426 Bytes

Versions: 30

Compression:

Stored size: 426 Bytes

Contents

# encoding: utf-8

require "benchmark"

$LOAD_PATH.unshift "lib"
require "ffi-icu"
require "rchardet"

TESTS = 1000

$rchardet = CharDet::UniversalDetector.new
$icu = ICU::CharDet::Detector.new

Benchmark.bmbm do |results|
  results.report("rchardet instance:") { TESTS.times { $rchardet.reset; $rchardet.feed("æåø"); $rchardet.result } }
  results.report("ffi-icu instance:") { TESTS.times { $icu.detect("æåø")  } }
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ffi-icu-0.1.0 benchmark/shared.rb
ffi-icu-0.0.9 benchmark/shared.rb
ffi-icu-0.0.8 benchmark/shared.rb
ffi-icu-0.0.7 benchmark/shared.rb
ffi-icu-0.0.6 benchmark/shared.rb
ffi-icu-0.0.5 benchmark/shared.rb
ffi-icu-0.0.4 benchmark/shared.rb
ffi-icu-0.0.3 benchmark/shared.rb
ffi-icu-0.0.2 benchmark/shared.rb
ffi-icu-0.0.1 benchmark/shared.rb