Changes

Jump to: navigation, search

User:Jorend/Deterministic hash tables

350 bytes added, 01:31, 23 February 2012
Method
The project contains two complete hash map implementations: OpenTable and CloseTable. A third implementation, DenseTable, is a thin wrapper around the <code>dense_hash_map</code> type from [https://code.google.com/p/sparsehash/ Sparsehash]. The three classes have the same API and were all benchmarked using the same templates (in hashbench.cpp).
Design Hash table implementation design notes:
* The API was designed to match the [http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets proposal for ECMAScript Map objects] as of February 2012.
* The purpose of the typedefs KeyArg and ValueArg is to make it possible to switch the API from pass-by-value to pass-by-reference by editing just a couple of lines of code. (I tried this. Pass-by-reference is no faster on 64-bit machines.)
 
Benchmark design notes:
 
* There would be more tests but it takes a long time to write them. Feel free to send me pull requests.
 
* The program runs each benchmark many different times in order to produce enough numbers that noise is visually obvious in the resulting graph. (Most of the speed graphs are nice and smooth.)
= Results =
638
edits

Navigation menu