On Thu, Jun 30, 2005 at 11:43:33AM -0400, John Peacock wrote: > p.s. is this _really_ necessary: > > > if (name[1] == '_' && > > name[2] == 'P' && > > name[3] == 'A' && > > name[4] == 'C' && > > name[5] == 'K' && > > name[6] == 'A' && > > name[7] == 'G' && > > name[8] == 'E' && > > name[9] == '_' && > > name[10] == '_') > > { /* __PACKAGE__ */ > > return -KEY___PACKAGE__; > > } > > i.e. isn't strEQ going to shortcircuit just as fast as individual char > tests???
We benchmarked it and the code generated by the current perl_keyword.pl was the fastest. If you (or anyone else) are (is) curious, it would be interesting to see what effect tweaking Devel::Tokenizer::C to use strEQ and then regenerating gives. Nicholas Clark