-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use Buffer.concat on node as it is faster (#73)
Running the concat.js benchmark: Before: ``` Uint8Arrays.concat x 792,619 ops/sec ±0.67% (98 runs sampled) Uint8Arrays.concat with length x 782,264 ops/sec ±0.18% (98 runs sampled) Uint8Array.set x 799,528 ops/sec ±0.67% (92 runs sampled) allocUnsafe.set x 851,403 ops/sec ±0.24% (97 runs sampled) Fastest is allocUnsafe.set ``` After: ``` Uint8Arrays.concat x 896,831 ops/sec ±0.20% (101 runs sampled) Uint8Arrays.concat with length x 887,523 ops/sec ±0.19% (99 runs sampled) Uint8Array.set x 814,749 ops/sec ±0.46% (98 runs sampled) allocUnsafe.set x 885,140 ops/sec ±0.28% (98 runs sampled) Fastest is Uint8Arrays.concat ```
- Loading branch information
1 parent
3706db6
commit 8d6c24b
Showing
4 changed files
with
12 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters