Looking for appropriate container
'Lo all.
I have been looking at some containers now.
Basically, I have an algorithm where I can use dynamic programming to store previously calculated results to speed it up greatly. Right.
So I need a map or hash container of sort. Constant to logarithmic lookup time and low overhead.
I've tried std::map (of course) and std::unordered_map. From a rough calculation, they use about 36 bytes per inserted item. The map itself looks something like std::map<unsigned long long, int>, so from that alone it should take roughly 12 bytes.
Does anyone know of any other possible container / code to experiment with to reduce the overhead? Just reducing the overhead by a few bytes would increase the number of items that I can fit into the container greatly and give me a speed boost. Hopefully.
I can roughly fit 29..826..161 items in 1 GB, which is not near enough.