language
language copied to clipboard
Slow parse times
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.
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 [email protected] 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: https://github.com/tolmasky/language/issues/18
Sure, my SN is chocoflyer.
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.
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
?