diff --git a/benchmark/mocha.js b/benchmark/mocha.js index 39912f9..abeae06 100644 --- a/benchmark/mocha.js +++ b/benchmark/mocha.js @@ -16,7 +16,7 @@ var Module = require('..') { profile.enabled = true - profile('beginning transform') + profile('beginning transform without source map') var ast = Module.parse(mocha) profile('parsed AST') ast = Module.transform(ast) @@ -24,3 +24,18 @@ var Module = require('..') recast.print(ast) profile('stringified AST') } + +{ + profile.enabled = true + profile('beginning transform with source map') + var ast = Module.parse(mocha, { + sourceFileName: 'mocha.js' + }) + profile('parsed AST') + ast = Module.transform(ast) + profile('transformed AST') + recast.print(ast, { + sourceMapName: 'mocha.js' + }) + profile('stringified AST') +} diff --git a/package.json b/package.json index 31c234a..41b9598 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "istanbul": "0" }, "scripts": { + "bench": "DEBUG=*:profile node benchmark/mocha.js", "test": "mocha --reporter spec --bail test/index.js", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/index.js", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/index.js"