Skip to content

Commit 193e65c

Browse files
committed
Added benchmark and profile related information to README [ci skip]
1 parent fc90148 commit 193e65c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ protobuf.js integrates into any browserify build-process. There are a few possib
379379

380380
Performance
381381
-----------
382-
The package includes a [benchmark](https://github.com/dcodeIO/protobuf.js/tree/master/bench) that tries to compare performance to native JSON as far as this is possible. On an i7-2600K running node 6.9.1 it yields:
382+
The package includes a benchmark that tries to compare performance to native JSON as far as this is possible. On an i7-2600K running node 6.9.1 it yields:
383383

384384
```
385385
benchmarking encoding performance ...
@@ -413,7 +413,7 @@ JSON to/from buffer x 89,593 ops/sec ±0.85% (87 runs sampled)
413413
JSON to/from buffer was 62.4% slower
414414
```
415415

416-
Note that JSON is a native binding nowadays and as such is *really* fast. So, how can protobuf.js be faster?
416+
Note that JSON is a native binding nowadays and as such is about as fast as it possibly can get. So, how can protobuf.js be faster?
417417

418418
* The benchmark is [somewhat flawed](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js).
419419
* Reader and writer interfaces configure themselves according to the environment to eliminate redundant conditionals.
@@ -425,7 +425,19 @@ Note that JSON is a native binding nowadays and as such is *really* fast. So, ho
425425

426426
Note that code generation requires `new Function(...)` (basically `eval`) support and that an equivalent but slower fallback will be used where unsupported.
427427

428-
Also note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths.
428+
You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ...
429+
430+
```
431+
$> npm run bench
432+
```
433+
434+
and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node):
435+
436+
```
437+
$> npm run prof <encode|decode|encode-browser|decode-browser> [iterations=10000000]
438+
```
439+
440+
Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths.
429441

430442
Compatibility
431443
-------------

0 commit comments

Comments
 (0)