benchmark-perf 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -7
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -2
- data/lib/benchmark/perf/execution_time.rb +3 -9
- data/lib/benchmark/perf/version.rb +1 -1
- data/spec/unit/execution_time_spec.rb +1 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a43708c402ffa6a74980be287c96ebd39ff118c1
|
4
|
+
data.tar.gz: 1d39bed38014e93c1393f48faf99b9b560834e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98d780c7f0143805be987a3b1be952dc6e3f3e29d4c00b4deb1be068c7316536434cb5efe48bb475b68e13c2dc9761b5cce2d996ee3910322da0f34beaefb2f7
|
7
|
+
data.tar.gz: ab929e3393f5621a45fccd5b63950b215a9fa86dc23f643881e3119896e6e3905192c3bd8c7f0080a27e2841cc0c996041d6d501cd89df448d0a6c33c5164d8c
|
data/.travis.yml
CHANGED
@@ -9,17 +9,18 @@ rvm:
|
|
9
9
|
- 2.2.5
|
10
10
|
- 2.3.1
|
11
11
|
- ruby-head
|
12
|
-
-
|
13
|
-
- jruby-head
|
14
|
-
- rbx-3.60
|
15
|
-
env:
|
16
|
-
global:
|
17
|
-
- JRUBY_OPTS="-Xcli.debug=true --debug"
|
12
|
+
- rbx
|
18
13
|
matrix:
|
14
|
+
include:
|
15
|
+
- rvm: jruby
|
16
|
+
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false -Xcompat.version=2.0'
|
17
|
+
- rvm: jruby-9.1.2.0
|
18
|
+
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
|
19
19
|
allow_failures:
|
20
|
-
- rvm: rbx
|
20
|
+
- rvm: rbx
|
21
21
|
- rvm: ruby-head
|
22
22
|
- rvm: jruby-head
|
23
|
+
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
|
23
24
|
fast_finish: true
|
24
25
|
branches:
|
25
26
|
only: master
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.2.0] - 2016-11-03
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Remove rescuing marshalling errors
|
7
|
+
|
3
8
|
## [v0.2.0] - 2016-11-01
|
4
9
|
|
5
10
|
### Added
|
@@ -20,6 +25,7 @@
|
|
20
25
|
|
21
26
|
Initial release
|
22
27
|
|
28
|
+
[v0.2.1]: https://github.com/peter-murach/benchmark-perf/compare/v0.2.0...v0.2.1
|
23
29
|
[v0.2.0]: https://github.com/peter-murach/benchmark-perf/compare/v0.1.1...v0.2.0
|
24
30
|
[v0.1.1]: https://github.com/peter-murach/benchmark-perf/compare/v0.1.0...v0.1.1
|
25
31
|
[v0.1.0]: https://github.com/peter-murach/benchmark-perf/compare/v0.1.0
|
data/Gemfile
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Benchmark
|
4
4
|
module Perf
|
5
|
-
MarshalError = Class.new(StandardError)
|
6
|
-
|
7
5
|
# Measure length of time the work could take on average
|
8
6
|
#
|
9
7
|
# @api public
|
@@ -68,13 +66,9 @@ module Benchmark
|
|
68
66
|
|
69
67
|
writer.close unless writer.closed?
|
70
68
|
Process.waitpid(pid)
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
data
|
75
|
-
rescue => error
|
76
|
-
raise MarshalError, "#{error.class}: #{error.message}"
|
77
|
-
end
|
69
|
+
data = Marshal.load(reader)
|
70
|
+
raise data if data.is_a?(Exception)
|
71
|
+
data
|
78
72
|
end
|
79
73
|
|
80
74
|
# Run warmup measurement
|
@@ -24,18 +24,10 @@ RSpec.describe Benchmark::Perf::ExecutionTime do
|
|
24
24
|
}.to raise_error(StandardError)
|
25
25
|
end
|
26
26
|
|
27
|
-
it "fails to load marshalled data" do
|
28
|
-
bench = described_class.new
|
29
|
-
allow(Marshal).to receive(:load).and_raise('boo')
|
30
|
-
expect {
|
31
|
-
bench.run { 'x' * 1024 }
|
32
|
-
}.to raise_error(Benchmark::Perf::MarshalError)
|
33
|
-
end
|
34
|
-
|
35
27
|
it "measures complex object" do
|
36
28
|
bench = described_class.new
|
37
29
|
sample = bench.run { {foo: Object.new, bar: :piotr} }
|
38
|
-
expect(sample).to all(be < 0.
|
30
|
+
expect(sample).to all(be < 0.01)
|
39
31
|
end
|
40
32
|
|
41
33
|
it "executes code to warmup ruby vm" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark-perf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|