Skip to content

Commit 0b28c4a

Browse files
Add nanobench benchmark (#81)
1 parent 71f0f61 commit 0b28c4a

File tree

7 files changed

+10382
-20
lines changed

7 files changed

+10382
-20
lines changed

bench/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jquery-3.3.1.js -diff

bench/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jquery-3.3.1.js

bench/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var bench = require('nanobench');
2+
var path = require('path');
3+
var fs = require('fs');
4+
var insert = require('../');
5+
6+
bench('jquery', function (b) {
7+
var source = fs.readFileSync(path.join(__dirname, 'jquery-3.3.1.js'));
8+
b.start();
9+
var stream = insert();
10+
stream.on('data', function() {});
11+
stream.on('end', function () {
12+
b.end();
13+
});
14+
stream.end(source);
15+
});

0 commit comments

Comments
 (0)