You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,7 +379,7 @@ protobuf.js integrates into any browserify build-process. There are a few possib
379
379
380
380
Performance
381
381
-----------
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:
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?
417
417
418
418
* The benchmark is [somewhat flawed](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js).
419
419
* 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
425
425
426
426
Note that code generation requires `new Function(...)` (basically `eval`) support and that an equivalent but slower fallback will be used where unsupported.
427
427
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.
0 commit comments