Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-07

Sorted map vs hash map ?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Serguei TARASSOV

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)

Show quoted text 19 lines
From: Serguei TARASSOV Subject: [fpc-pascal] Sorted map vs hash map ? Message-ID: 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