2 ms·
> But I can't imagine a lexer would ever be the performance bottleneck in a compiler. one rather trivial way to observe the effects of avoiding building a sour
by signa11 10y ago
> But I can't imagine a lexer would ever be the performance bottleneck in a compiler.
one rather trivial way to observe the effects of avoiding building a source file is to use ccache. ccache avoids the recompilation (even if you do a make clean, or some such), and it is not uncommon to observe speed ups of factor of 5 or so.
however, once you have crossed that barrier, you hit the linking wall. which is where you would end up spending a large portion of time. gold (https://en.wikipedia.org/wiki/Gold_(linker) https://en.wikipedia.org/wiki/Gold_(linker)) optimizes that i.e. supports incremental linking, but unfortunately, i haven't had any experience in large code-bases where it is being used.
- pertymcpert 10y agoNo chance, modern compilers spend most of their time in the optimization stages. Lexing is peanuts.
- signa11 10y agoTry it. You _might_ be surprised :)