Sha256: 63fdb5d9a0f204c70778d080cb481e7d699ea0d71fe77a8bc5cc9963ac5aff01

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'benchmark/ips'
require 'character_set'
require 'set'

def benchmark(caption: nil, cases: {})
  puts caption

  report = Benchmark.ips do |x|
    cases.each do |label, callable|
      x.report(label, &callable)
    end
    x.compare!
  end

  return unless $store_comparison_results

  old_stdout = $stdout.clone
  captured_stdout = StringIO.new
  $stdout = captured_stdout
  report.run_comparison
  $store_comparison_results[caption] = captured_stdout.string
  $stdout = old_stdout
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
character_set-1.4.0-java benchmarks/shared.rb
character_set-1.4.0 benchmarks/shared.rb
character_set-1.3.0-java benchmarks/shared.rb
character_set-1.3.0 benchmarks/shared.rb