Closed matjaz closed 12 years ago
I've benchmarked /w browserify.
detective /w uglify-js
total detective time 86519
total compile time 1582
detective /w esprima
total detective time 80951
total compile time 1580
So we can say it's faster around 5-10%.
I just revisited this using a much bigger file and a quick esprima parser I wrote and the performance improvement is much more noteworthy:
> var src = require('fs').readFileSync('./node_modules/jquery-browserify/lib/jquery.js'); var find = require('./esp').find; var t0 = Date.now(); var res = find(src); Date.now() - t0
333
> var src = require('fs').readFileSync('./node_modules/jquery-browserify/lib/jquery.js'); var find = require('./').find; var t0 = Date.now(); var res = find(src); Date.now() - t0
1283
Nearly a 4x speedup.
Good to hear that. Esprima kicks ass.
The latest detective is now using esprima but I'm not seeing too much of a speedup in browserify since there's a lot of other caching going on that hides the performance gains. The browserify test suite does run a few seconds faster now at least.
+1
+1
Do you have any figures about what this does to performance?