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

Sergei Gorelkin sergei_gorelkin at mail.ru
Wed Oct 20 15:03:11 CEST 2010


Alexander Klenin пишет:
> 
> Ok, I re-tested with 2*10^6 Find's. Then AnsiString variants wins even
> for length 5:
> 
> ShortString: 0.547 s
> AnsiString: 0.437 s
> 
Running the test, I get quite opposite results:

0.750 sec
0.766 sec
short add:  1.829 sec
short find: 0.781 sec
ansi add:   1.750 sec
ansi find:  1.406 sec

The only modifications I made to the test is added printing separate numbers for 'find' and 'add', 
and printing labels. Modified test is attached.

Although theoretically Find() should show no difference at all, because it performs the same 
operations on the same data. IOW, the difference seen is caused either by CPU cache effects, or by 
bugs in testing.

No difference between the first two numbers (IntToStr for ShortString and AnsiString) is also quite 
suspicious...

Regards,
Sergei
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t.lpr
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20101020/047bc56c/attachment.ksh>


More information about the fpc-devel mailing list