From 866781f4e118c5e300c44d5258b22f312cfa24a1 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 14 Feb 2014 13:06:39 -0800 Subject: [PATCH] add silly benchmarks --- Makefile | 5 ++++- benchmark/index.js | 16 ++++++++++++++++ package.json | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 benchmark/index.js diff --git a/Makefile b/Makefile index 9987df8..1d0285a 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,7 @@ test: --reporter dot \ --bail -.PHONY: test \ No newline at end of file +bench: + @./node_modules/.bin/matcha + +.PHONY: test bench \ No newline at end of file diff --git a/benchmark/index.js b/benchmark/index.js new file mode 100644 index 0000000..06366c7 --- /dev/null +++ b/benchmark/index.js @@ -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) + }) +}) diff --git a/package.json b/package.json index a5be7b3..2f31118 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ }, "devDependencies": { "mocha": "*", - "should": "*" + "should": "*", + "matcha": "~0.4.1" }, "license": "MIT" }