Skip to content

Commit

Permalink
benchmark recast with and without source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Aug 18, 2014
1 parent d7e7514 commit 29e45e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion benchmark/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,26 @@ 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)
profile('transformed AST')
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')
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 29e45e9

Please sign in to comment.