benchmark-ips 2.8.3 → 2.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/benchmark/ips.rb +1 -1
- data/lib/benchmark/ips/job.rb +1 -1
- data/test/test_benchmark_ips.rb +14 -0
- 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: 574d0cb84279e02316df55c8d96f396b2a10301b15639ede54198eb278fd6ba2
|
4
|
+
data.tar.gz: d4ddabd9c093fd2c9559870818543d105c6fb2bbf3d38ad397b3bdf0df691397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 701868e1d0e33101daaf7e5005245b327dbf3b3d02fb19a8e89eb39563540b5ca5b1ff91c4e3cd4bd9dd54f97537ca48e668608742ee0569a13336818ddfef23
|
7
|
+
data.tar.gz: a032682bd26691ad5d4a837ba956b9acf50e45c69036e07bdda347791f78bf388cb3339873fd6d5ca9cbf6edeec5090c15ae6fa56a712f6d0f0340729ce8e792
|
data/History.txt
CHANGED
data/lib/benchmark/ips.rb
CHANGED
data/lib/benchmark/ips/job.rb
CHANGED
@@ -188,7 +188,7 @@ module Benchmark
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def load_held_results
|
191
|
-
return unless @held_path && !File.zero?(@held_path)
|
191
|
+
return unless @held_path && File.exist?(@held_path) && !File.zero?(@held_path)
|
192
192
|
require "json"
|
193
193
|
@held_results = {}
|
194
194
|
JSON.load(IO.read(@held_path)).each do |result|
|
data/test/test_benchmark_ips.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "minitest/autorun"
|
2
2
|
require "benchmark/ips"
|
3
3
|
require "stringio"
|
4
|
+
require "tmpdir"
|
4
5
|
|
5
6
|
class TestBenchmarkIPS < Minitest::Test
|
6
7
|
def setup
|
@@ -182,4 +183,17 @@ class TestBenchmarkIPS < Minitest::Test
|
|
182
183
|
assert data[0]["ips"]
|
183
184
|
assert data[0]["stddev"]
|
184
185
|
end
|
186
|
+
|
187
|
+
def test_hold!
|
188
|
+
temp_file_name = Dir::Tmpname.create(["benchmark-ips", ".tmp"]) { }
|
189
|
+
|
190
|
+
Benchmark.ips(:time => 0.001, :warmup => 0.001) do |x|
|
191
|
+
x.report("operation") { 100 * 100 }
|
192
|
+
x.report("operation2") { 100 * 100 }
|
193
|
+
x.hold! temp_file_name
|
194
|
+
end
|
195
|
+
|
196
|
+
assert File.exist?(temp_file_name)
|
197
|
+
File.unlink(temp_file_name)
|
198
|
+
end
|
185
199
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark-ips
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Phoenix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.1.
|
110
|
+
rubygems_version: 3.1.4
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: An iterations per second enhancement to Benchmark.
|