benchmark_driver 0.15.7 → 0.15.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/exe/benchmark-driver +5 -0
- data/lib/benchmark_driver.rb +1 -0
- data/lib/benchmark_driver/rbenv.rb +1 -1
- data/lib/benchmark_driver/repeater.rb +1 -8
- data/lib/benchmark_driver/ridkuse.rb +1 -1
- data/lib/benchmark_driver/ruby_interface.rb +6 -0
- data/lib/benchmark_driver/rvm.rb +48 -0
- data/lib/benchmark_driver/version.rb +1 -1
- 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: e04ca43a3337139b2b4608642785f79e058062c9559a77bb488c4b6171d6f6a5
|
4
|
+
data.tar.gz: 9f3d95083d39c13dcb7586a949df6d6ac95253f5ae0f36c1e611e1ed45316a6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 513c1e5dbe4703708fb13cf970b1c96c14ff008ebfc5f13381388d5d857f1b76089cfd1b8347ef8a50461af5aa9aeed79180f1dcd68341586cb77081bed01cd1
|
7
|
+
data.tar.gz: a90e8729e8724ad50fb42731d5e3fa53acb5a722e3eb2ae26f18a435f9cb02af6eb0a6a69a2676cb02cceab9d7cc563b751e477819497f99fcedf42a918362a6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -75,6 +75,7 @@ Usage: benchmark-driver [options] [YAML|RUBY]
|
|
75
75
|
-o, --output [TYPE] Specify output type: compare, simple, markdown, record (default: compare)
|
76
76
|
-e, --executables [EXECS] Ruby executables (e1::path1 arg1; e2::path2 arg2;...)
|
77
77
|
--rbenv [VERSIONS] Ruby executables in rbenv (x.x.x arg1;y.y.y arg2;...)
|
78
|
+
--rvm [VERSIONS] Ruby executables in rvm (x.x.x arg1;y.y.y arg2;...)
|
78
79
|
--repeat-count [NUM] Try benchmark NUM times and use the fastest result or the worst memory usage
|
79
80
|
--repeat-result [TYPE] Yield "best", "average" or "worst" result with --repeat-count (default: best)
|
80
81
|
--bundler Install and use gems specified in Gemfile
|
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('--rvm VERSIONS', String, 'Ruby executables in rvm (x.x.x arg1;y.y.y arg2;...)') do |r|
|
52
|
+
r.split(';').each do |version|
|
53
|
+
executables << BenchmarkDriver::Rvm.parse_spec(version)
|
54
|
+
end
|
55
|
+
end if system("which rvm > #{File::NULL} 2>&1")
|
51
56
|
o.on('--ridkuse VERSIONS', String, 'Ruby executables in ridk use (x.x.x arg1;y.y.y arg2;...) for RubyInstaller2 on Windows') do |r|
|
52
57
|
r.split(';').each do |version|
|
53
58
|
executables << BenchmarkDriver::RidkUse.parse_spec(version)
|
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/rvm'
|
6
7
|
require 'benchmark_driver/repeater'
|
7
8
|
require 'benchmark_driver/ridkuse'
|
8
9
|
require 'benchmark_driver/ruby_interface'
|
@@ -11,7 +11,7 @@ module BenchmarkDriver
|
|
11
11
|
path
|
12
12
|
end
|
13
13
|
|
14
|
-
# @param [String] full_spec - "2.5.0", "2.5.0
|
14
|
+
# @param [String] full_spec - "2.5.0", "2.5.0 --jit", "JIT::2.5.0 --jit", etc.
|
15
15
|
def self.parse_spec(full_spec)
|
16
16
|
name, spec = full_spec.split('::', 2)
|
17
17
|
spec ||= name # if `::` is not given, regard whole string as spec
|
@@ -43,7 +43,7 @@ module BenchmarkDriver
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
# @param [String] full_spec - "2.6.3", "2.6.3p62", "2.6.3
|
46
|
+
# @param [String] full_spec - "2.6.3", "2.6.3p62", "2.6.3 --jit", etc.
|
47
47
|
def self.parse_spec(full_spec)
|
48
48
|
name, spec = full_spec.split('::', 2)
|
49
49
|
spec ||= name # if `::` is not given, regard whole string as spec
|
@@ -71,6 +71,12 @@ module BenchmarkDriver
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
def rvm(*versions)
|
75
|
+
versions.each do |version|
|
76
|
+
@executables << BenchmarkDriver::Rvm.parse_spec(version)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
74
80
|
# ridk use command for RubyInstaller2 on Windows
|
75
81
|
def ridkuse(*versions)
|
76
82
|
versions.each do |version|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
module BenchmarkDriver
|
5
|
+
module Rvm
|
6
|
+
# Execute "which -a ruby" command to get a list of Ruby versions from $PATH.
|
7
|
+
def self.system_ruby_path
|
8
|
+
env_rubies = `which -a ruby`
|
9
|
+
abort "Failed to execute 'which -a ruby'" unless $?.success?
|
10
|
+
|
11
|
+
env_rubies.each_line do |line|
|
12
|
+
if !line.match(ENV['rvm_path'])
|
13
|
+
return line.rstrip
|
14
|
+
end
|
15
|
+
end
|
16
|
+
abort "System ruby not found"
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param [String] version
|
20
|
+
def self.ruby_path(version)
|
21
|
+
path = if version == 'system'
|
22
|
+
system_ruby_path
|
23
|
+
else
|
24
|
+
rubies = Pathname.new("#{ENV['rvm_path']}/rubies")
|
25
|
+
abort "Rubies path '#{rubies}' not found" unless rubies.exist?
|
26
|
+
ruby_root = rubies.children.detect { |path| path.directory? && path.basename.to_s.match(version) }
|
27
|
+
abort "Version '#{version}' not found" unless ruby_root
|
28
|
+
"#{ruby_root}/bin/ruby"
|
29
|
+
end
|
30
|
+
|
31
|
+
unless File.exist?(path)
|
32
|
+
abort "Binary '#{path}' not found"
|
33
|
+
end
|
34
|
+
path
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param [String] full_spec - "2.5.0", "2.5.0 --jit", "JIT::2.5.0 --jit", etc.
|
38
|
+
def self.parse_spec(full_spec)
|
39
|
+
name, spec = full_spec.split('::', 2)
|
40
|
+
spec ||= name # if `::` is not given, regard whole string as spec
|
41
|
+
version, *args = spec.shellsplit
|
42
|
+
BenchmarkDriver::Config::Executable.new(
|
43
|
+
name: name,
|
44
|
+
command: [BenchmarkDriver::Rvm.ruby_path(version), *args],
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
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.15.
|
4
|
+
version: 0.15.8
|
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: 2020-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/benchmark_driver/runner/recorded.rb
|
125
125
|
- lib/benchmark_driver/runner/ruby_stdout.rb
|
126
126
|
- lib/benchmark_driver/runner/time.rb
|
127
|
+
- lib/benchmark_driver/rvm.rb
|
127
128
|
- lib/benchmark_driver/struct.rb
|
128
129
|
- lib/benchmark_driver/version.rb
|
129
130
|
homepage: https://github.com/benchmark-driver/benchmark-driver
|
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.1.2
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Fully-featured accurate benchmark driver for Ruby
|