C++ map insertion and lookup performance and storage overhead

前端 未结 8 2230
旧巷少年郎
旧巷少年郎 2021-02-02 10:47

I would like to store a mapping of an integer key to a float value in-memory.

I have roughly 130 million keys (and, accordingly, 130 million v

8条回答
  •  忘掉有多难
    2021-02-02 11:42

    Most compilers ship with a non-standard (but working) hash_map (or unordered_map) that might be faster for you. It's coming in C++0x (is in tr1) and it is also (as always) in boost already.

    GCC did too, but I haven't done C++ on that for .. 12 years .., but it should still be in there somewhere.

提交回复
热议问题