Last active
January 15, 2016 18:18
-
-
Save thejefflarson/bb6a7c651cddd305a18f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const Benchmark = require('benchmark'); | |
| var bench = Benchmark({ | |
| fn : function(){ | |
| var a = new Buffer(1024); | |
| } | |
| }); | |
| console.log(String(bench.run())); | |
| // $ ./node benchmark.js | |
| // <Test #1> x 1,196,283 ops/sec ±1.27% (80 runs sampled) | |
| // $ node benchmark.js | |
| // <Test #1> x 1,234,358 ops/sec ±1.67% (76 runs sampled) | |
| // $ ./node benchmark/common.js buffers | |
| buffers/buffer-creation.js | |
| buffers/buffer-creation.js type=fast len=10 n=1024: 3623.97512 | |
| buffers/buffer-creation.js type=fast len=1024 n=1024: 1188.15860 | |
| buffers/buffer-creation.js type=slow len=10 n=1024: 1128.48789 | |
| buffers/buffer-creation.js type=slow len=1024 n=1024: 955.14037 | |
| // $ node benchmark/common.js buffers | |
| buffers/buffer-creation.js | |
| buffers/buffer-creation.js type=fast len=10 n=1024: 2818.92383 | |
| buffers/buffer-creation.js type=fast len=1024 n=1024: 1313.60635 | |
| buffers/buffer-creation.js type=slow len=10 n=1024: 966.95189 | |
| buffers/buffer-creation.js type=slow len=1024 n=1024: 891.08745 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment