[fpc-devel] Parser speed

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Oct 22 14:22:04 CEST 2010


Graeme Geldenhuys schrieb:

> If the source code only contains tabs characters, instead of spaces,
> does... that means the source code files are a lot smaller. Does that also
> result in the compiler parsing those files faster? After all, there is a
> lot less characters to parse.
> 
> Anybody actually done a speed test on this to see the speed difference?

Skipping tab chars or the equivalent amount of space chars is not much 
different in runtime. More critical is the update of the current column, 
that is a simple inc(col,1) for spaces, but deserves some lengthier 
computation for tabs - in detail with elastic or otherwise variable tab 
stops. I'm not sure how the scanner can ever provide reasonable column 
values at all, when it's up to "the" (which???) editor, and the possibly 
user-specified tab width (Lazarus), to expand the tabs into spaces.

DoDi




More information about the fpc-devel mailing list