[fpc-devel] TFPHashList (Was: Alternative parsers)

Alexander Klenin klenin at gmail.com
Wed Oct 20 12:12:06 CEST 2010


On Wed, Oct 20, 2010 at 20:36, Florian Klaempfl <florian at freepascal.org> wrote:
> Keep also in mind that the extra indirection of ansistrings increases
> cache polution (one access touches two instead of one cache line) and
> this might not be modelled by the test. So in a real world example
> shortstrings have another advantage over ansistrings. Of course, I
> suspect that using ansistrings against shortstrings would be hardly
> measurable in the compiler speed, but one hundred of such micro
> optimizations might make the compiler twice as fast.

All true. However, my main point was that all those micro-optimizations
obfuscate the code.
One day all this obfuscation may prevent some higher-level optimization,
like multi-threading or built-in linking,
which would gain more then 2x speedup.
Another point: I have actually complained about pchars, not shortstrings.
Shortstrings are not any worse than AnsiStrings in usage,
until one stays within 255 chars limit.
PChars, on the other hand, require manual memory management
which is the source of bugs.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list