benchmark_driver 0.10.12 → 0.10.13

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: 8476feea0b9fe972915f9cf0ca928cbdc34321e477f042c239965a9e41db2560
4
- data.tar.gz: 5004f72484e4c00318043d9947f50f7dfdd4f4cbb2ddd27e2f48809c7b9d165a
3
+ metadata.gz: 888668b113284dcb442c1d9bfb4fc37563b1b73b26bd93c21d6b823e0dcace4e
4
+ data.tar.gz: 92413919e8a9959fa88137da71cda69a5941bec2988b71fc365d47f08d254b57
5
5
  SHA512:
6
- metadata.gz: c8950a06fc9c5f894c6a4b11125b19b3ffe81fa1c483c0300605fd5e22ca8b7688d58bb97427b873db15759323f0617863640383a26a45efe4982948e595ddb9
7
- data.tar.gz: c64f920ef9bb625c6ee82980d4b889c78695a211a4ae5ca5d41728e9597cdda5b2130995dbca854edfab858559896dbb8c6fdbe7ba847bff1620fa21a99c91ab
6
+ metadata.gz: e16d5a6c38b9145778e08f045a7022b8b5d648f9f8b66afafa32158fd8bf52ab9c9f2fe7e895ae4fbbbf7ff977fdb7a57b592e6e4e150de1fc256b6cd8fdc446
7
+ data.tar.gz: 88055b5b9ef159b75540c62b47eb54bf78316e9174e4f7ef9a3e1768fe0151f6a067814cff4b150cf2fa102d309741793d3c72f9c8e0f7b95c2502052b1f7d30
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.10.13
2
+
3
+ - Add `x.output` to specify output plugin to Ruby interface
4
+ - You can still use `Benchmark.driver(output: xxx)` form too
5
+
1
6
  # v0.10.12
2
7
 
3
8
  - Fix some typo in help
data/README.md CHANGED
@@ -2,29 +2,23 @@
2
2
 
3
3
  Fully-featured accurate benchmark driver for Ruby
4
4
 
5
- ## Project Status
6
-
7
- Beta.
8
-
9
- Interface might be changed in the future, but it's almost fixed and many features can run well.
10
-
11
5
  ## Features
12
6
  ### Accurate Measurement
13
7
 
14
8
  - Low overhead benchmark by running generated script instead of calling Proc
15
- - Profiling memory, high-precision real time, user time and system time
9
+ - Profiling memory and high-precision real time
16
10
  - Running multiple times to minimize measurement errors
17
11
 
18
12
  ### Pluggable & Fully Featured
19
13
 
20
- - Flexible and real-time output format in ips, execution time, markdown table, etc.
21
- - Benchmark with various running options
14
+ - Flexible and real-time output format in comparison, markdown table, graph, etc.
15
+ - Measuring various metrics by specifying runners
22
16
  - Integrated benchmark support using external libraries
23
17
  - Runner and output format are all pluggable
24
18
 
25
19
  ### Flexible Interface
26
20
 
27
- - Ruby interface similar to benchmark stdlib, benchmark-ips
21
+ - Ruby interface similar to stdlib benchmark.rb, benchmark-ips
28
22
  - YAML input to easily manage structured benchmark set
29
23
  - Comparing multiple Ruby binaries, even with miniruby
30
24
 
@@ -151,6 +145,27 @@ Comparison:
151
145
  2.4.1: 1889805.6 i/s - 1.72x slower
152
146
  ```
153
147
 
148
+ ## Output options
149
+
150
+ By default, there are following output options.
151
+
152
+ * compare: benchmark-ips's `compare!`-like output (default)
153
+ * simple: ruby's original `benchmark/driver.rb`-like simple output
154
+ * markdown: output in markdown table
155
+ * record: serialize results in `benchmark_driver.record.yml`, to change outputs later as you like
156
+
157
+ With `benchmark-driver` CLI, you can specify it with `-o [output]` or `--output [output]`.
158
+
159
+ With Ruby interface, you can specify it like:
160
+
161
+ ```rb
162
+ Benchmark.driver do |x|
163
+ x.prelude %{ array = [] }
164
+ x.report 'Array#empty?', %{ array.empty? }
165
+ x.output 'markdown'
166
+ end
167
+ ```
168
+
154
169
  ## Contributing
155
170
 
156
171
  Bug reports and pull requests are welcome on GitHub at https://github.com/k0kubun/benchmark_driver.
@@ -9,5 +9,5 @@ Benchmark.driver do |x|
9
9
  EOS
10
10
  x.report 'Array#empty?', %{ array.empty? }
11
11
  x.report 'Array#blank?', %{ array.blank? }
12
- x.compare!
12
+ x.output 'markdown'
13
13
  end
@@ -55,6 +55,10 @@ module BenchmarkDriver
55
55
  @jobs << { benchmark: [{ name: name, script: script }] }
56
56
  end
57
57
 
58
+ def output(type)
59
+ @config.output_type = type
60
+ end
61
+
58
62
  # Backward compatibility. This is actually default now.
59
63
  def compare!
60
64
  @config.output_type = 'compare'
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.10.12'
2
+ VERSION = '0.10.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.12
4
+ version: 0.10.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun