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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +25 -10
- data/examples/exec_blank.rb +1 -1
- data/lib/benchmark_driver/ruby_interface.rb +4 -0
- data/lib/benchmark_driver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888668b113284dcb442c1d9bfb4fc37563b1b73b26bd93c21d6b823e0dcace4e
|
4
|
+
data.tar.gz: 92413919e8a9959fa88137da71cda69a5941bec2988b71fc365d47f08d254b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e16d5a6c38b9145778e08f045a7022b8b5d648f9f8b66afafa32158fd8bf52ab9c9f2fe7e895ae4fbbbf7ff977fdb7a57b592e6e4e150de1fc256b6cd8fdc446
|
7
|
+
data.tar.gz: 88055b5b9ef159b75540c62b47eb54bf78316e9174e4f7ef9a3e1768fe0151f6a067814cff4b150cf2fa102d309741793d3c72f9c8e0f7b95c2502052b1f7d30
|
data/CHANGELOG.md
CHANGED
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
|
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
|
21
|
-
-
|
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
|
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.
|
data/examples/exec_blank.rb
CHANGED
@@ -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'
|