/
opt
/
canhelp
/
node_modules
/
split2
/
/opt/canhelp/node_modules/split2
mkdir
upload
Name
Size
Mode
Actions
bench.js
472
0644
edit
dl
rm
index.js
3764
0644
edit
dl
rm
LICENSE
764
0644
edit
dl
rm
package.json
1113
0644
edit
dl
rm
README.md
3381
0644
edit
dl
rm
test.js
7925
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/split2/bench.js
(472B)
'use strict' const split = require('./') const bench = require('fastbench') const binarySplit = require('binary-split') const fs = require('fs') function benchSplit (cb) { fs.createReadStream('package.json') .pipe(split()) .on('end', cb) .resume() } function benchBinarySplit (cb) { fs.createReadStream('package.json') .pipe(binarySplit()) .on('end', cb) .resume() } const run = bench([ benchSplit, benchBinarySplit ], 10000) run(run)
Save
cmd:
run