Inohashmap

Stores values for strings in a Hashmap in a fast and compact way.

Good to count strings and assign ids to them or similar. Address space of string data is limited to u32::MAX (4GB). string data is size in bytes of all uniquely inserted strings + string length metadata per string.

Example

use inohashmap::StringHashMap; let mut hashmap = StringHashMap::<u32>::new(); let val = hashmap.get_or_create("blub1", 0); assert_eq!(*val, 0); *val += 1; let val = hashmap.get_or_create("blub2", 2); assert_eq!(*val, 2);

Memory Consumption

Memory Consumption is lower than with a regular hashmap, 30% lower in the compare_allocations test.

Bench

``` Running target/release/deps/bench-f01c908733fbb7f4

running 8 tests test tests::benchfnv ... bench: 137,678 ns/iter (+/- 10,262) test tests::benchfnvfull ... bench: 5,021,742 ns/iter (+/- 251,143) test tests::benchhasmap ... bench: 118,997 ns/iter (+/- 8,068) test tests::benchhasmapfull ... bench: 4,858,801 ns/iter (+/- 242,614) test tests::benchhasmapfulllargestruct ... bench: 5,634,283 ns/iter (+/- 293,666) test tests::benchtanttermmap ... bench: 136,552 ns/iter (+/- 6,591) test tests::benchtanttermmapfull ... bench: 5,659,779 ns/iter (+/- 345,914) test tests::benchtanttermmapfulllargestruct ... bench: 5,769,806 ns/iter (+/- 371,247) ```