benchmark_driver 0.16.1 → 0.16.3
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/exe/benchmark-driver +5 -0
- data/lib/benchmark_driver/chruby.rb +27 -0
- data/lib/benchmark_driver/runner.rb +14 -0
- data/lib/benchmark_driver/version.rb +1 -1
- data/lib/benchmark_driver.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0286746ad8c7c0b6c5c5eaaa9e224c9a1e62785c55a5285053c9150eb2297f8a'
|
4
|
+
data.tar.gz: 9cb1292f11551d0ad1de357532d8ae5b1b6b97ad666395c53e1ebc787221e536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bb68b47e082eff267c213968ef34684a032bbb93152cb592307114e787480a21237307be72a0b22f553b3a0102547abc662cf00fac0e797c92cc6078aecc34a
|
7
|
+
data.tar.gz: a22277c75ef96e21c9dafda77a7d7fbe8ac279dfe7c48cf9c55bb02cd7c74597edc397cac7db24902ab05225f795ec10a0b01618e6fb401f4480a7b8ced3b0d6
|
data/CHANGELOG.md
CHANGED
data/exe/benchmark-driver
CHANGED
@@ -48,6 +48,11 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
48
48
|
executables << BenchmarkDriver::Rbenv.parse_spec(version)
|
49
49
|
end
|
50
50
|
end if system("which rbenv > #{File::NULL} 2>&1")
|
51
|
+
o.on('--chruby VERSIONS', String, 'Ruby executables in chruby (x.x.x arg1;y.y.y arg2;...)') do |r|
|
52
|
+
r.split(';').each do |version|
|
53
|
+
executables << BenchmarkDriver::Chruby.parse_spec(version)
|
54
|
+
end
|
55
|
+
end if Dir.exist?('/opt/rubies') || Dir.exist?("#{ENV['HOME']}/.rubies")
|
51
56
|
o.on('--rvm VERSIONS', String, 'Ruby executables in rvm (x.x.x arg1;y.y.y arg2;...)') do |r|
|
52
57
|
r.split(';').each do |version|
|
53
58
|
executables << BenchmarkDriver::Rvm.parse_spec(version)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
|
3
|
+
module BenchmarkDriver
|
4
|
+
module Chruby
|
5
|
+
# @param [String] version
|
6
|
+
def self.ruby_path(version)
|
7
|
+
prefix = (Dir.glob('/opt/rubies/*') + Dir.glob("#{ENV['HOME']}/.rubies/*")).find do |dir|
|
8
|
+
File.basename(dir) == version
|
9
|
+
end
|
10
|
+
unless prefix
|
11
|
+
abort "Failed to find '#{version}' in /opt/rubies or ~/.rubies"
|
12
|
+
end
|
13
|
+
"#{prefix}/bin/ruby"
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param [String] full_spec - "2.5.0", "2.5.0 --jit", "JIT::2.5.0 --jit", etc.
|
17
|
+
def self.parse_spec(full_spec)
|
18
|
+
name, spec = full_spec.split('::', 2)
|
19
|
+
spec ||= name # if `::` is not given, use the whole string as spec
|
20
|
+
version, *args = spec.shellsplit
|
21
|
+
BenchmarkDriver::Config::Executable.new(
|
22
|
+
name: name,
|
23
|
+
command: [BenchmarkDriver::Chruby.ruby_path(version), *args],
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -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
|
data/lib/benchmark_driver.rb
CHANGED
@@ -3,6 +3,7 @@ require 'benchmark_driver/config'
|
|
3
3
|
require 'benchmark_driver/job_parser'
|
4
4
|
require 'benchmark_driver/output'
|
5
5
|
require 'benchmark_driver/rbenv'
|
6
|
+
require 'benchmark_driver/chruby'
|
6
7
|
require 'benchmark_driver/rvm'
|
7
8
|
require 'benchmark_driver/repeater'
|
8
9
|
require 'benchmark_driver/ridkuse'
|
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.3
|
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-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- images/optcarrot.png
|
101
101
|
- lib/benchmark_driver.rb
|
102
102
|
- lib/benchmark_driver/bulk_output.rb
|
103
|
+
- lib/benchmark_driver/chruby.rb
|
103
104
|
- lib/benchmark_driver/config.rb
|
104
105
|
- lib/benchmark_driver/default_job.rb
|
105
106
|
- lib/benchmark_driver/default_job_parser.rb
|
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
147
|
- !ruby/object:Gem::Version
|
147
148
|
version: '0'
|
148
149
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.4.1
|
150
151
|
signing_key:
|
151
152
|
specification_version: 4
|
152
153
|
summary: Fully-featured accurate benchmark driver for Ruby
|