I'm afraid I don't. I'm still picking it up. But I did narrow it down to an 
issue parsing unicode characters.

https://github.com/kschiess/parslet/issues/73 is a much more succinct example.

I'm slowly picking up ruby-prof and learning how to use the output to point a 
finger at misbehaving code. My next step is to install a patched version of 
1.9.3 so I could profile the memory to see if the GC is going haywire at some 
point.

-Zach


On Mar 19, 2013, at 1:35 AM, Nigel Thorne wrote:

> I'm sorry no-one has responded  yet to your well constructed question.  I 
> don't have the knowledge to answer you, I'd have to profile the parser to 
> work out the possible cause.
> 
> Have you any experience profiling Ruby?
> 
> Cheers
> Nigel
> 
> On Mar 18, 2013 10:31 AM, "Zach Moazeni" <[email protected]> wrote:
> Ah shoot. I realized I forgot to mention some specs.
> 
> I'm using parslet v1.5.0 on ruby 1.9.3-p385. I'm on a Macbook Air, but I 
> don't think the machine is the issue.
> 
> -Zach
> 
> On Mar 17, 2013, at 7:21 PM, Zach Moazeni wrote:
> 
> > Hi folks,
> >
> > I'm working on a course grained css parser, and I've noticed that parsing 
> > css comments swamps my performance. Can anyone give me a hand and point out 
> > if I'm doing something silly? As well as any tips on how to approach 
> > optimizing a parser.
> >
> > https://gist.github.com/zmoazeni/9208f594bdf61aed1419
> >
> > https://gist.github.com/zmoazeni/9208f594bdf61aed1419#file-file-with-comments-css
> >  (file with comments) takes ~20 seconds to parse on my machine while 
> > https://gist.github.com/zmoazeni/9208f594bdf61aed1419#file-file-without-comments-css
> >  (file without comments) takes ~3 seconds.
> >
> > I'm surprised that the comments ruin the performance so dramatically. This 
> > obviously gets much worse as the css file gets larger.
> >
> > I appreciate any help,
> >
> > Thanks!
> > -Zach
> 

Reply via email to