Python dictionaries are pretty fast

published Sep 04, 2015 01:50   by admin ( last modified Sep 04, 2015 01:50 )

Yesterday I found myself looking at Google dense hash maps in C++. Googling around about them, I found a page from incise.org benchmarking different hashes in C++.

The author, on a lark he writes, decided to include dictionaries from Python and the corresponding data structure from Ruby. It turns out that python dictionaries aren't slow at all. Here two diagrams from the post:

 

They are fast, but take up a fair bit of memory. More diagrams and te text in the original post:

 

 

 

I've put together a set of benchmarks of what I consider to be the most prominent C and C++ hash table implementations. I've made the code available at Github. If you have any critiques or corrections, please post a comment below, email me, or fork the code and send me a pull request on Github.


 

Read more: Link - Hash Table Benchmarks