Sha256: b34568691682260f96dd01c47124ac45defd0de8a0cebaa938ec5b42f0380fcf

Contents?: true

Size: 697 Bytes

Versions: 4

Compression:

Stored size: 697 Bytes

Contents

desc 'Run all IPS benchmarks'
task :benchmark do
  Dir["#{__dir__}/benchmarks/*.rb"].sort.each { |file| load(file) }
end

namespace :benchmark do
  desc 'Run all IPS benchmarks and store the comparison results in BENCHMARK.md'
  task :write_to_file do
    Rake.application[:benchmark].invoke

    # extract comparison results from reports
    results = $benchmark_results
      .map { |caption, report| "```\n#{caption}\n\n#{report[/(?<=Comparison:).+/m].strip}\n```" }
      .join("\n")
      .gsub(/ \(±[^)]+\) |(?<=same-ish).*/, '') # remove some noise

    File.write "#{__dir__}/../BENCHMARK.md",
               "Results of `rake:benchmark` on #{RUBY_DESCRIPTION}\n\n#{results}\n"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
character_set-1.8.0-java tasks/benchmark.rake
character_set-1.8.0 tasks/benchmark.rake
character_set-1.7.0-java tasks/benchmark.rake
character_set-1.7.0 tasks/benchmark.rake