Skip to content

Commit

Permalink
add silly benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 14, 2014
1 parent 3cc7254 commit 866781f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ test:
--reporter dot \
--bail

.PHONY: test
bench:
@./node_modules/.bin/matcha

.PHONY: test bench
16 changes: 16 additions & 0 deletions benchmark/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

var fs = require('fs');
var parse = require('..');

var large = fs.readFileSync('examples/page.xml', 'utf8');
var small = fs.readFileSync('examples/developerforce.xml', 'utf8');

suite('parse', function(){
bench('small', function(){
parse(small)
})

bench('large', function(){
parse(large)
})
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
"devDependencies": {
"mocha": "*",
"should": "*"
"should": "*",
"matcha": "~0.4.1"
},
"license": "MIT"
}

0 comments on commit 866781f

Please sign in to comment.