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.5.3 benchmark/shared.rb
ffi-icu-0.5.2 benchmark/shared.rb
ffi-icu-0.5.1 benchmark/shared.rb
ffi-icu-0.5.0 benchmark/shared.rb
ffi-icu-0.4.3 benchmark/shared.rb
ffi-icu-0.4.2 benchmark/shared.rb
ffi-icu-0.4.1 benchmark/shared.rb
ffi-icu-0.4.0 benchmark/shared.rb
ffi-icu-0.3.0 benchmark/shared.rb
ffi-icu-0.2.0 benchmark/shared.rb
ffi-icu-0.1.10 benchmark/shared.rb
ffi-icu-0.1.9 benchmark/shared.rb
ffi-icu-0.1.8 benchmark/shared.rb
ffi-icu-0.1.7 benchmark/shared.rb
ffi-icu-0.1.6 benchmark/shared.rb
ffi-icu-0.1.5 benchmark/shared.rb
ffi-icu-0.1.4 benchmark/shared.rb
ffi-icu-0.1.3 benchmark/shared.rb
ffi-icu-0.1.2 benchmark/shared.rb
ffi-icu-0.1.1 benchmark/shared.rb