Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

replaced uglify-js with esprima #13

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

matjaz commented Jun 13, 2012

No description provided.

Owner

substack commented Jun 13, 2012

Do you have any figures about what this does to performance?

matjaz commented Jun 14, 2012

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%.

Owner

substack commented Jul 30, 2012

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.

matjaz commented Jul 30, 2012

Good to hear that. Esprima kicks ass.

Owner

substack commented Jul 30, 2012

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.

@substack substack closed this Jul 30, 2012

ariya commented Aug 3, 2012

+1

tonysung commented Aug 3, 2012

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment