[fpc-pascal] Sorted map vs hash map ?

Serguei TARASSOV serge at arbinada.com
Tue Jul 21 14:22:40 CEST 2015


The problem was in the proper generation of random keys for testing.
Now it looks better.
I added statistics with different key's density ("normal" usage is 
unique keys)

On 21/07/2015 12:00, fpc-pascal-request at lists.freepascal.org wrote:
> From: Serguei TARASSOV<serge at arbinada.com>
> To:fpc-pascal at lists.freepascal.org
> Subject: [fpc-pascal] Sorted map vs hash map ?
> Message-ID:<55AD4820.8000403 at arbinada.com>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Hi all,
>
> I did a small test to compare performance of TFPGMap and TFPHashList in
> sequential and random accessing values by keys.
> http://arbinada.com/main/en/node/1511
>
> The results are not the same than expected.
> In theory, the hash map should give O(1) and O(log2 N) for the sorted map.
>
> Any explanations and suggestions are welcome.
>
> Regards,
> Serguei




More information about the fpc-pascal mailing list