Looking for champion - std.lang.d.lex

Walter Bright newshound2 at digitalmars.com
Tue Oct 26 21:46:12 PDT 2010


Nick Sabalausky wrote:
> As for whether or not this effect can be reasonably accomplished with 
> structs: I have no idea, I haven't really looked into it.

I use a tagged variant for the token struct.

This doesn't make any difference if one is parsing small pieces of code. But 
when you're trying to stuff millions of lines of code down its maw, avoiding an 
allocation per token is a big deal.

The indirect calls to the member functions of a class also perform poorly 
relative to tagged variants.


More information about the Digitalmars-d mailing list