Skip to content

Commit

Permalink
Merge pull request #51 from 513ry/master
Browse files Browse the repository at this point in the history
Load lib directory properly in benchmark
  • Loading branch information
fbernier authored Dec 16, 2024
2 parents a1eaa06 + a78fece commit 4edc50c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions benchmarks/bench.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
require_relative '../lib/tomlrb'

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'tomlrb'
begin
require 'toml-rb'
rescue LoadError
Expand All @@ -10,12 +12,11 @@
data = File.read(File.join(__dir__, '../test/example-v0.4.0.toml'))

Benchmark.ips do |x|

x.report("emancu/toml-rb") do
x.report('emancu/toml-rb') do
TomlRB.parse(data)
end

x.report("fbernier/tomlrb") do
x.report('fbernier/tomlrb') do
Tomlrb.parse(data)
end

Expand Down

0 comments on commit 4edc50c

Please sign in to comment.