benchmark-ips 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +2 -0
- data/lib/benchmark/ips.rb +1 -1
- data/lib/benchmark/ips/stats/bootstrap.rb +51 -0
- data/lib/benchmark/ips/stats/sd.rb +33 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbf6e5f13ed635a69ab099631340497b0305df4e
|
4
|
+
data.tar.gz: 010de92f654e0dc25d1770b9ce83944540d71920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97c18c2d2bf77dd41320fdd5336b2aa562fc0db2b46f8a38866d087491c3d3a52b0e732b2169eaf330bb30e14822f01ff5d4f2f670d99a05624e30721c32bf53
|
7
|
+
data.tar.gz: 3cc170d620547e78039a1e007a2fe17aaa6dd0ac6c06d571b0e26aaab0933db69cde62cc63042d3fb6e2c0d2fb54135ea5f5b6c519923a0787284583f7564b4f
|
data/Manifest.txt
CHANGED
@@ -11,5 +11,7 @@ lib/benchmark/ips/job/entry.rb
|
|
11
11
|
lib/benchmark/ips/job/stdout_report.rb
|
12
12
|
lib/benchmark/ips/report.rb
|
13
13
|
lib/benchmark/ips/share.rb
|
14
|
+
lib/benchmark/ips/stats/bootstrap.rb
|
15
|
+
lib/benchmark/ips/stats/sd.rb
|
14
16
|
lib/benchmark/timing.rb
|
15
17
|
test/test_benchmark_ips.rb
|
data/lib/benchmark/ips.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
module Benchmark
|
2
|
+
module IPS
|
3
|
+
module Stats
|
4
|
+
|
5
|
+
class Bootstrap
|
6
|
+
|
7
|
+
attr_reader :data
|
8
|
+
|
9
|
+
def initialize(samples, confidence)
|
10
|
+
dependencies
|
11
|
+
@iterations = 10_000
|
12
|
+
@confidence = (confidence / 100.0).to_s
|
13
|
+
@data = Kalibera::Data.new({[0] => samples}, [1, samples.size])
|
14
|
+
interval = @data.bootstrap_confidence_interval(@iterations, @confidence)
|
15
|
+
@median = interval.median
|
16
|
+
@error = interval.error
|
17
|
+
end
|
18
|
+
|
19
|
+
def central_tendency
|
20
|
+
@median
|
21
|
+
end
|
22
|
+
|
23
|
+
def error
|
24
|
+
@error
|
25
|
+
end
|
26
|
+
|
27
|
+
def slowdown(baseline)
|
28
|
+
low, slowdown, high = baseline.data.bootstrap_quotient(@data, @iterations, @confidence)
|
29
|
+
error = Timing.mean([slowdown - low, high - slowdown])
|
30
|
+
[slowdown, error]
|
31
|
+
end
|
32
|
+
|
33
|
+
def footer
|
34
|
+
"with #{(@confidence.to_f * 100).round(1)}% confidence"
|
35
|
+
end
|
36
|
+
|
37
|
+
def dependencies
|
38
|
+
require 'kalibera'
|
39
|
+
rescue LoadError
|
40
|
+
puts
|
41
|
+
puts "Can't load the kalibera gem - this is required to use the :bootstrap stats options."
|
42
|
+
puts "It's optional, so we don't formally depend on it and it isn't installed along with benchmark-ips."
|
43
|
+
puts "You probably want to do something like 'gem install kalibera' to fix this."
|
44
|
+
abort
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Benchmark
|
2
|
+
module IPS
|
3
|
+
module Stats
|
4
|
+
|
5
|
+
class SD
|
6
|
+
|
7
|
+
def initialize(samples)
|
8
|
+
@mean = Timing.mean(samples)
|
9
|
+
@error = Timing.stddev(samples, @mean).round
|
10
|
+
end
|
11
|
+
|
12
|
+
def central_tendency
|
13
|
+
@mean
|
14
|
+
end
|
15
|
+
|
16
|
+
def error
|
17
|
+
@error
|
18
|
+
end
|
19
|
+
|
20
|
+
def slowdown(baseline)
|
21
|
+
slowdown = baseline.central_tendency.to_f / central_tendency
|
22
|
+
[slowdown, nil]
|
23
|
+
end
|
24
|
+
|
25
|
+
def footer
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
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.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Phoenix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -75,6 +75,8 @@ files:
|
|
75
75
|
- lib/benchmark/ips/job/stdout_report.rb
|
76
76
|
- lib/benchmark/ips/report.rb
|
77
77
|
- lib/benchmark/ips/share.rb
|
78
|
+
- lib/benchmark/ips/stats/bootstrap.rb
|
79
|
+
- lib/benchmark/ips/stats/sd.rb
|
78
80
|
- lib/benchmark/timing.rb
|
79
81
|
- test/test_benchmark_ips.rb
|
80
82
|
homepage: https://github.com/evanphx/benchmark-ips
|