anybody want popi efficiency patches?

Russ Nelson nelson at SUN.SOE.CLARKSON.EDU
Mon Aug 13 12:11:38 AEST 1990


Hi.  I have some patches to popi that make it a little more efficient.  As
currently implemented, popi uses int opcodes that are either characters or
integers larger than any possible character (i.e. starting at 256).  As
anyone who's ever looked at the code generated by switch(), these types of
case values results in slow code.  Specifically, Turbo C 2.0 generates a
large number of "cmp ax,value;je $+5;jmp next_case".

Switch generates much better code if you use an enum (or #defines if you
must).  More like "jmp table[ax]" (although not exactly that).  Anyway,
that's the change I made.  The change would have been straightforward,
except that popi confused lexical token values with opcode values in a
number of places, so I fixed the lexical parsing to use a separate set
of values.  That's probably about half the changes.

So, if anyone cares, send me email and I'll post them (about 34K).  NO
point in posting them if no one cares, right?

-- 
--russ (nelson at clutx [.bitnet | .clarkson.edu])  Russ.Nelson@$315.268.6667
We won the cold war.  The Russians spent trillions defending their stuff,
then they found that they didn't have any stuff.  Will we avoid the same trap?



More information about the Comp.sources.bugs mailing list