benchmark-ips 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5c89b6607d6960de72e63e6e14ee0283f2dbe3f2418f33d90b57e947f555d70
4
- data.tar.gz: 5ee11f5ae33b1c426a90deba5799a739cd13d785d5ab7c4e4ffaa942d5ddc8db
3
+ metadata.gz: bc54b5cf0d24b23822486adf5759cceeefbef9a60c780454318472f4739050f6
4
+ data.tar.gz: ea2764b060fef8c931c4636eb63e84d48f98242f7335648fed8b82b2fdeb053d
5
5
  SHA512:
6
- metadata.gz: 52e1d308de07129514ff4c6c9848a0e68f074937ab2cd05b75060ac055655bc581f382041ddd21780439f682540fdb3ee5d041214a677dc87cd8a527b587bfe8
7
- data.tar.gz: fbb5b4045f318f31772eb3e27cc6f49c1589d857d13c17d7e16c52d82be5253aef30b7c327f8f76f9e14cc3c81bd496423f1f043e8cd7287074a31466bd49b07
6
+ metadata.gz: 72ed2d83e42b125ca812aa1e79113be4726f8bb2e0ca4cb784dddc1d70eddc16c088308e1214cba9f7ec83ad77d89d9ae544b7892b6abac8f3e0b88d1617e7a8
7
+ data.tar.gz: 94bda95d5db4a9032692e732a04eb3147ad3839b0e674f13d676b1fdf2130a8f0a269e6f5817791683965bf86662be10c7e5476e0539d71916b6b35562ac7806
data/History.md CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
data/examples/advanced.rb CHANGED
File without changes
data/examples/hold.rb CHANGED
File without changes
data/examples/save.rb CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -8,6 +8,7 @@ module Benchmark
8
8
  end
9
9
 
10
10
  def start_warming
11
+ @out.puts RUBY_DESCRIPTION
11
12
  @out.puts "Warming up --------------------------------------"
12
13
  end
13
14
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/benchmark/ips.rb CHANGED
@@ -17,7 +17,7 @@ module Benchmark
17
17
  module IPS
18
18
 
19
19
  # Benchmark-ips Gem version.
20
- VERSION = "2.12.0"
20
+ VERSION = "2.13.0"
21
21
 
22
22
  # CODENAME of current version.
23
23
  CODENAME = "Long Awaited"
@@ -82,20 +82,15 @@ module Benchmark
82
82
  end
83
83
 
84
84
  module Helpers
85
+ SUFFIXES = ['', 'k', 'M', 'B', 'T', 'Q'].freeze
86
+
85
87
  def scale(value)
86
- scale = (Math.log10(value) / 3).to_i
87
- suffix = case scale
88
- when 1; 'k'
89
- when 2; 'M'
90
- when 3; 'B'
91
- when 4; 'T'
92
- when 5; 'Q'
93
- else
94
- # < 1000 or > 10^15, no scale or suffix
95
- scale = 0
96
- ' '
97
- end
98
- "%10.3f#{suffix}" % (value.to_f / (1000 ** scale))
88
+ scale = (Math.log10(value) / 3).to_i
89
+ scale = 0 if scale < 0 || scale >= SUFFIXES.size
90
+ suffix = SUFFIXES[scale]
91
+ scaled_value = value.to_f / (1000 ** scale)
92
+
93
+ "%10.3f#{suffix}" % scaled_value
99
94
  end
100
95
  module_function :scale
101
96
  end
@@ -1,5 +1,5 @@
1
1
  module Benchmark
2
- # Perform caclulations on Timing results.
2
+ # Perform calculations on Timing results.
3
3
  module Timing
4
4
  # Microseconds per second.
5
5
  MICROSECONDS_PER_SECOND = 1_000_000
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-ips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
- rubygems_version: 3.3.20
91
+ rubygems_version: 3.3.7
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: A iterations per second enhancement to Benchmark.