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

Florian Klaempfl florian at freepascal.org
Wed Oct 20 11:36:39 CEST 2010


Am 20.10.2010 11:21, schrieb Alexander Klenin:
> On Wed, Oct 20, 2010 at 19:16, Florian Klaempfl <florian at freepascal.org> wrote:
>> Am 20.10.2010 09:23, schrieb Alexander Klenin:
> 
>> Also Add is probably broken. I cannot see where AddStr does proper ref.
>> counting.
> 
> Indeed. And after I fixed it, the Add have really slowed down by 5-50%
> depending on string length.
> OTOH, with ansistrings the whole concept of FStrs/StrIndex is redundant,
> and some minor speedup may be achieved by removing it.
> 

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.



More information about the fpc-devel mailing list