Skip to content

Commit 514b1d9

Browse files
committed
doc: add more info to benchmark/README.md
Adds info on the `wrk` prerequisite for http benchmarks and how to run benchmarks with options. PR-URL: #629 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Evan Lucas <[email protected]>
1 parent 097fde7 commit 514b1d9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

benchmark/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
This folder contains benchmark tests to measure the performance for certain
44
io.js APIs.
55

6+
## prerequisites
7+
8+
Most of the http benchmarks require `wrk` to be compiled beforehand.
9+
10+
```sh
11+
make wrk
12+
```
13+
614
## How to run tests
715

816
There are two ways to run benchmark tests:
@@ -80,6 +88,20 @@ buffers/buffer-read.js noAssert=false buffer=fast type=UInt16BE millions=1: 245.
8088
...
8189
```
8290

91+
3. Run tests with options
92+
93+
This example will run only the first type of url test, with one iteration.
94+
(Note: benchmarks require __many__ iterations to be statistically accurate.)
95+
96+
97+
```sh
98+
iojs benchmark/url/url-parse.js type=one n=1
99+
```
100+
Output:
101+
```
102+
url/url-parse.js type=one n=1: 1663.74402
103+
```
104+
83105
## How to write a benchmark test
84106

85107
The benchmark tests are grouped by types. Each type corresponds to a subdirectory,

0 commit comments

Comments
 (0)