benchmark_driver 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/benchmark_driver/output/markdown.rb +3 -7
- data/lib/benchmark_driver/runner.rb +14 -0
- data/lib/benchmark_driver/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f9cf509e30003805a04ef225d6941f96b355f833121ef8bc3dcb35476a12569
|
4
|
+
data.tar.gz: d8709282ed2d0505322b124c68a6a618f3085f906ae3f503cf6b2333756c7d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcc32a63dc71bfa73a80f2e21adff057ef24baa939c17f613e7c26c4cd737c1345ecd713c5f4245eb8877fa08528d219e44a31b1dfe2c2924a683f003293a53f
|
7
|
+
data.tar.gz: deff92f21009fe2d306a49b100b3a04c1ec490f4658400573dc71345f276ffee99956c8c340cd0704548d99b6bb716ebd0d35c8e91b07692d32a79fa8b240830
|
data/CHANGELOG.md
CHANGED
@@ -133,13 +133,9 @@ class BenchmarkDriver::Output::Markdown
|
|
133
133
|
if context == worst
|
134
134
|
result = '-'
|
135
135
|
else
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
else
|
140
|
-
result = best_result.fdiv(worst_result)
|
141
|
-
end
|
142
|
-
result = sprintf("%.2fx", result)
|
136
|
+
val = result.values.first[1]
|
137
|
+
ratio = val.fdiv(worst_result)
|
138
|
+
result = sprintf("%.2fx", ratio)
|
143
139
|
end
|
144
140
|
length = [context.name.length, NAME_LENGTH].max
|
145
141
|
$stdout.printf("|%*s", length, result)
|
@@ -98,6 +98,16 @@ module BenchmarkDriver
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def with_clean_env(&block)
|
101
|
+
# chruby sets GEM_HOME and GEM_PATH in your shell. We have to unset it in the child
|
102
|
+
# process to avoid installing gems to the version that is running benchmark-driver.
|
103
|
+
env = nil
|
104
|
+
['GEM_HOME', 'GEM_PATH'].each do |var|
|
105
|
+
if ENV.key?(var)
|
106
|
+
env ||= ENV.to_h
|
107
|
+
ENV.delete(var)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
101
111
|
unless defined?(Gem::Version)
|
102
112
|
# default-gem Bundler can be loaded and broken with --disable-gems
|
103
113
|
return block.call
|
@@ -115,6 +125,10 @@ module BenchmarkDriver
|
|
115
125
|
end
|
116
126
|
rescue LoadError
|
117
127
|
block.call
|
128
|
+
ensure
|
129
|
+
if env
|
130
|
+
ENV.replace(env)
|
131
|
+
end
|
118
132
|
end
|
119
133
|
end
|
120
134
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.4.10
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Fully-featured accurate benchmark driver for Ruby
|