Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow parse times #18

Open
ide opened this issue Feb 4, 2012 · 4 comments
Open

Slow parse times #18

ide opened this issue Feb 4, 2012 · 4 comments

Comments

@ide
Copy link

ide commented Feb 4, 2012

I haven't done any profiling so this is a rather generic issue, but the parser performance is rather slow. For example:

> function benchmark() {
... var jquery = require('fs').readFileSync('./jquery-1.7.1.js', 'utf-8');
... console.time('parse');
... parser.parse(jquery);
... console.timeEnd('parse');
... }
> benchmark()
parse: 12042ms

I'm surprised because the theoretical performance should be quite high so I'm guessing that high number of object allocations, especially for the deep expression productions (how many nodes does it take to represent a simple string literal?) is hurting performance.

@tolmasky
Copy link
Owner

tolmasky commented Feb 5, 2012

Are you on aim? I've done a lot research regarding this and it's easier to explain there.

Sent from my iPhone

On Feb 4, 2012, at 3:15 PM, James Idereply@reply.github.com wrote:

I haven't done any profiling so this is a rather generic issue, but the parser performance is rather slow. For example:

> function benchmark() {
... var jquery = require('fs').readFileSync('./jquery-1.7.1.js', 'utf-8');
... console.time('parse');
... parser.parse(jquery);
... console.timeEnd('parse');
... }
> benchmark()
parse: 12042ms

I'm surprised because the theoretical performance should be quite high so I'm guessing that high number of object allocations, especially for the deep expression productions (how many nodes does it take to represent a simple string literal?) is hurting performance.


Reply to this email directly or view it on GitHub:
#18

@ide
Copy link
Author

ide commented Feb 5, 2012

Sure, my SN is chocoflyer.

@anodos
Copy link

anodos commented Sep 5, 2012

I'm curious what the latest is here. I am interesting in faster parses. Even a little pointer in the right direction might help with optimization.

@dongli
Copy link

dongli commented Jul 2, 2013

I have tried Ruby PEG parser generator Parslet, and it takes around 10 seconds to parse a Fortran code with 2000+ lines. This is really slow. So what about this Language.js?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants