C++ map insertion and lookup performance and storage overhead

前端 未结 8 2207
旧巷少年郎
旧巷少年郎 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:49

    If your keys are unchanging, you might consider a perfect hash function as an alternative to a standard container.

    I don't know what obstacles you'll run into with a dataset of that size, but it might be worth spending a few minutes experimenting.

提交回复
热议问题