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
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -700,45 +700,45 @@ The package includes a benchmark that compares protobuf.js performance to native
700
700
```
701
701
benchmarking encoding performance ...
702
702
703
-
protobuf.js (reflect) x 547,366 ops/sec ±1.29% (90 runs sampled)
704
-
protobuf.js (static) x 525,722 ops/sec ±1.17% (91 runs sampled)
705
-
JSON (string) x 311,180 ops/sec ±0.67% (93 runs sampled)
706
-
JSON (buffer) x 183,724 ops/sec ±0.69% (92 runs sampled)
707
-
google-protobuf x 76,337 ops/sec ±0.73% (91 runs sampled)
703
+
protobuf.js (reflect) x 540,622 ops/sec ±0.87% (89 runs sampled)
704
+
protobuf.js (static) x 537,928 ops/sec ±1.19% (91 runs sampled)
705
+
JSON (string) x 317,124 ops/sec ±0.63% (91 runs sampled)
706
+
JSON (buffer) x 185,945 ops/sec ±0.72% (89 runs sampled)
707
+
google-protobuf x 76,552 ops/sec ±0.85% (91 runs sampled)
708
708
709
709
protobuf.js (reflect) was fastest
710
-
protobuf.js (static) was 3.8% slower
711
-
JSON (string) was 42.8% slower
712
-
JSON (buffer) was 66.2% slower
713
-
google-protobuf was 86.0% slower
710
+
protobuf.js (static) was 0.01 times slower (-0.8% ops/sec)
711
+
JSON (string) was 0.70 times slower (-41.2% ops/sec)
712
+
JSON (buffer) was 1.90 times slower (-65.6% ops/sec)
713
+
google-protobuf was 6.06 times slower (-85.8% ops/sec)
714
714
715
715
benchmarking decoding performance ...
716
716
717
-
protobuf.js (reflect) x 1,401,958 ops/sec ±0.78% (93 runs sampled)
718
-
protobuf.js (static) x 1,391,017 ops/sec ±0.78% (90 runs sampled)
719
-
JSON (string) x 301,749 ops/sec ±0.88% (93 runs sampled)
720
-
JSON (buffer) x 268,792 ops/sec ±0.84% (90 runs sampled)
721
-
google-protobuf x 186,727 ops/sec ±0.81% (90 runs sampled)
717
+
protobuf.js (reflect) x 1,386,221 ops/sec ±0.95% (93 runs sampled)
718
+
protobuf.js (static) x 1,397,599 ops/sec ±0.74% (91 runs sampled)
719
+
JSON (string) x 300,667 ops/sec ±0.88% (90 runs sampled)
720
+
JSON (buffer) x 265,276 ops/sec ±0.88% (90 runs sampled)
721
+
google-protobuf x 162,202 ops/sec ±0.85% (92 runs sampled)
722
722
723
-
protobuf.js (reflect) was fastest
724
-
protobuf.js (static) was 0.8% slower
725
-
JSON (string) was 78.5% slower
726
-
JSON (buffer) was 80.8% slower
727
-
google-protobuf was 86.7% slower
723
+
protobuf.js (static) was fastest
724
+
protobuf.js (reflect) was 0.01 times slower (-1.0% ops/sec)
725
+
JSON (string) was 3.65 times slower (-78.5% ops/sec)
726
+
JSON (buffer) was 4.28 times slower (-81.0% ops/sec)
727
+
google-protobuf was 7.63 times slower (-88.4% ops/sec)
728
728
729
729
benchmarking combined performance ...
730
730
731
-
protobuf.js (reflect) x 274,685 ops/sec ±0.99% (89 runs sampled)
732
-
protobuf.js (static) x 278,352 ops/sec ±1.00% (90 runs sampled)
733
-
JSON (string) x 129,638 ops/sec ±0.83% (91 runs sampled)
734
-
JSON (buffer) x 90,904 ops/sec ±0.93% (87 runs sampled)
735
-
google-protobuf x 43,327 ops/sec ±0.89% (90 runs sampled)
731
+
protobuf.js (reflect) x 277,238 ops/sec ±0.95% (92 runs sampled)
732
+
protobuf.js (static) x 281,732 ops/sec ±0.91% (91 runs sampled)
733
+
JSON (string) x 128,615 ops/sec ±1.01% (88 runs sampled)
734
+
JSON (buffer) x 89,794 ops/sec ±1.28% (88 runs sampled)
735
+
google-protobuf x 40,987 ops/sec ±1.29% (90 runs sampled)
736
736
737
737
protobuf.js (static) was fastest
738
-
protobuf.js (reflect) was 1.3% slower
739
-
JSON (string) was 53.3% slower
740
-
JSON (buffer) was 67.3% slower
741
-
google-protobuf was 84.4% slower
738
+
protobuf.js (reflect) was 0.02 times slower (-1.6% ops/sec)
739
+
JSON (string) was 1.19 times slower (-54.4% ops/sec)
740
+
JSON (buffer) was 2.15 times slower (-68.2% ops/sec)
741
+
google-protobuf was 5.90 times slower (-85.5% ops/sec)
742
742
```
743
743
744
744
You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ...
process.stdout.write("\n"+chalk.white(pad(fastest.name,padSize))+" was "+chalk.green("fastest")+"\n");
27
27
benches.slice(1).forEach(function(bench){
28
28
varhz=getHz(bench);
29
-
varpercent=(1-hz/fastestHz)*100;
30
-
process.stdout.write(chalk.white(pad(bench.name,padSize))+" was "+chalk.red(percent.toFixed(1)+"% slower")+"\n");
29
+
varpercent=(1-hz/fastestHz);// less total operations per time
30
+
varfactor=-(1-fastestHz/hz);// additional time it takes to complete the same number of operations
31
+
process.stdout.write(chalk.white(pad(bench.name,padSize))+" was "+chalk.red(factor.toFixed(2)+" times slower (-"+(percent*100).toFixed(1)+"% ops/sec)")+"\n");
0 commit comments