超高性能C / C ++哈希表(表,词典) [英] Super high performance C/C++ hash map (table, dictionary)

查看:198
本文介绍了超高性能C / C ++哈希表(表,词典)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要映射原始密钥(INT,也许很长),以结构在一个高性能的哈希映​​射数据结构的值。

I need to map primitive keys (int, maybe long) to struct values in a high-performance hash map data structure.

我的程序将这些地图几百,而且每个地图一般最多有几千个条目。但是,地图将是提神或搅动不断;想象加工百万添加删除的消息一秒钟。

My program will have a few hundred of these maps, and each map will generally have at most a few thousand entries. However, the maps will be "refreshing" or "churning" constantly; imagine processing millions of add and delete messages a second.

用C什么库或C ++有适合这种使用情况的数据结构?或者,你会如何建议建立自己的?谢谢!

What libraries in C or C++ have a data structure that fits this use case? Or, how would you recommend building your own? Thanks!

推荐答案

我会建议你尝试谷歌SparseHash ,看看它是否适合你的需要。他们有一个内存高效的实现,以及一个用于速度进行了优化。
我做了一个标杆在很久以前,它是在速度(但有缺点)。

I would recommend you to try Google SparseHash and see if it suits your needs. They have a memory efficient implementation as well as one optimized for speed. I did a benchmark a long time ago, it was the best hashtable implementation available in terms of speed (however with drawbacks).

这篇关于超高性能C / C ++哈希表(表,词典)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆