On Wed, 2007-06-13 at 18:17 -0400, Matt Sergeant wrote: > Charlie Brady wrote: > > I don't think a lex/yacc parser will necessarily parse faster than a > > perl parser, so I don't think that GB of logfiles would justify writing > > a parser in C. Frequent executation of a parser OTOH might. A perl > > parser will very likely be slower to start up, but might execute just as > > fast once running. > > To be fair, in general a parser written in lex/yacc will usually be an > order of magnitude faster than the same parser written in perl with regexp.
Always that much? I realize that a lex/yacc parser will be more efficient but I thought perl's regex engine was pretty fast. > > Much as a love perl, there are sometimes undeniable performance benefits > for using other languages. Perl arrays are particularly slow for doing numerical work. In one case I converted a perl program to C and execution times went from 24 hours to 5 minutes (300:1). > > Matt. > -- --gh
