source: node_modules/split2/bench.js

main
Last change on this file was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 13 days ago

Project Handcraft Marketplace

  • Property mode set to 100644
File size: 472 bytes
Line 
1'use strict'
2
3const split = require('./')
4const bench = require('fastbench')
5const binarySplit = require('binary-split')
6const fs = require('fs')
7
8function benchSplit (cb) {
9 fs.createReadStream('package.json')
10 .pipe(split())
11 .on('end', cb)
12 .resume()
13}
14
15function benchBinarySplit (cb) {
16 fs.createReadStream('package.json')
17 .pipe(binarySplit())
18 .on('end', cb)
19 .resume()
20}
21
22const run = bench([
23 benchSplit,
24 benchBinarySplit
25], 10000)
26
27run(run)
Note: See TracBrowser for help on using the repository browser.