main
|
Last change
on this file was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago |
|
Project Handcraft Marketplace
|
-
Property mode
set to
100644
|
|
File size:
472 bytes
|
| Line | |
|---|
| 1 | 'use strict'
|
|---|
| 2 |
|
|---|
| 3 | const split = require('./')
|
|---|
| 4 | const bench = require('fastbench')
|
|---|
| 5 | const binarySplit = require('binary-split')
|
|---|
| 6 | const fs = require('fs')
|
|---|
| 7 |
|
|---|
| 8 | function benchSplit (cb) {
|
|---|
| 9 | fs.createReadStream('package.json')
|
|---|
| 10 | .pipe(split())
|
|---|
| 11 | .on('end', cb)
|
|---|
| 12 | .resume()
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | function benchBinarySplit (cb) {
|
|---|
| 16 | fs.createReadStream('package.json')
|
|---|
| 17 | .pipe(binarySplit())
|
|---|
| 18 | .on('end', cb)
|
|---|
| 19 | .resume()
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | const run = bench([
|
|---|
| 23 | benchSplit,
|
|---|
| 24 | benchBinarySplit
|
|---|
| 25 | ], 10000)
|
|---|
| 26 |
|
|---|
| 27 | run(run)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.