Significant name length list

Walter Bright bright at Data-IO.COM
Tue Jul 25 04:53:18 AEST 1989


In article <1989Jul23.021533.27429 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
<In article <116 at psitech.UUCP> david at psitech.UUCP (david Fridley) writes:
<<Requiring there to be a maximum name length is the sign of an inexperienced
<<programmer.  It is a simple process to tag each symbol with its length and
<<realloc() the block untill it is big enough for any symbol...
<Nobody with any sense is going to implement a fixed limit in a new compiler,

In the interminable quest for faster compilation, I've done a lot of profiling
of my parser (Zortech). One of the major time sinks is pulling in the
characters and stuffing them into the identifier array. The identifier array
is therefore static because it's faster to access a static array than one
that is accessed through a pointer.

I did, however, bump up the size of the array to 127. Nobody seems to have
run into that yet :-). If they do, I'll increase it to 256. The limit is
just a #define in a header file.

If you think I'm wrong about doing this to maximize performance, consider
that my compiler is within 10% of TurboC's compilation speed, and it's
a two pass compiler as opposed to TurboC's one pass. I've estimated that
the two pass design costs about 25% in compilation speed.

Real-world programming is always tradeoffs, no rule is absolute and no
feature comes for free.



More information about the Comp.std.c mailing list