This is the testing result with google sparse hash's bench mark (time_hash_map.cc in google sparse hash's tar ball)
The only modify totime_hash_map.cc is added the test for gold_hash_map (see diff below)
87a88
> #include <febird/gold_hash_map.hpp>
172a174,178
> template<typename K, typename V, typename H>
> class EasyUse_gold_hash_map : public gold_hash_map<K,V,H> {
> public:
> void resize(size_t r) { this->rehash(r); }
> };
669a676,679
> measure_map< EasyUse_gold_hash_map<ObjType, int, HashFn>,
> EasyUse_gold_hash_map<ObjType*, int, HashFn> >(
> "gold_hash_map", obj_size, iters, stress_hash_function);
>
source:
gold_hash_map.hpp
Here is the result!
======
Linux ubuntu 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 16:11:24 UTC 2011 x86_64
Average over 1000000 iterations
Current time (GMT): Sun Oct 23 09:39:22 2011
SPARSE_HASH_MAP (4 byte objects, 1000000 iterations):
map_grow 1610.0 ns ( 2677704 hashes, 5677753 copies)
map_predict/grow 630.0 ns ( 1000000 hashes, 4000005 copies)
map_replace 350.0 ns ( 3677704 hashes, 5677753 copies)
map_fetch_random 810.0 ns ( 3677704 hashes, 5677753 copies)
map_fetch_sequential 740.0 ns ( 3677704 hashes, 5677753 copies)
map_fetch_empty 370.0 ns ( 0 hashes, 1 copies)
map_remove 1120.0 ns ( 3677704 hashes, 6677753 copies)
map_toggle 2110.0 ns ( 2039999 hashes, 5159997 copies)
stresshashfunction map_size=256 stride=1: 3001.7ns/insertion
stresshashfunction map_size=256 stride=256: 2361.4ns/insertion
stresshashfunction map_size=1024 stride=1: 5443.1ns/insertion
stresshashfunction map_size=1024 stride=1024: 5883.4ns/insertion
DENSE_HASH_MAP (4 byte objects, 1000000 iterations):
map_grow 700.0 ns ( 2048576 hashes, 9242963 copies)
map_predict/grow 250.0 ns ( 1000000 hashes, 6097195 copies)
map_replace 200.0 ns ( 3048576 hashes, 9242963 copies)
map_fetch_random 230.0 ns ( 3048576 hashes, 9242963 copies)
map_fetch_sequential 200.0 ns ( 3048576 hashes, 9242963 copies)
map_fetch_empty 60.0 ns ( 0 hashes, 35 copies)
map_remove 400.0 ns ( 3048576 hashes, 10242963 copies)
map_toggle 1040.0 ns ( 2062499 hashes, 7499995 copies)
stresshashfunction map_size=256 stride=1: 1841.1ns/insertion
stresshashfunction map_size=256 stride=256: 520.3ns/insertion
stresshashfunction map_size=1024 stride=1: 2841.6ns/insertion
stresshashfunction map_size=1024 stride=1024: 1520.9ns/insertion
STANDARD HASH_MAP (4 byte objects, 1000000 iterations):
map_grow 240.0 ns ( 2025530 hashes, 4000000 copies)
map_predict/grow 230.0 ns ( 1000000 hashes, 4000000 copies)
map_replace 60.0 ns ( 3025530 hashes, 4000000 copies)
map_fetch_random 220.0 ns ( 3025530 hashes, 4000000 copies)
map_fetch_sequential 100.0 ns ( 3025530 hashes, 4000000 copies)
map_fetch_empty 130.0 ns ( 1000000 hashes, 0 copies)
map_remove 130.0 ns ( 3025530 hashes, 4000000 copies)
map_toggle 350.0 ns ( 2000000 hashes, 4000000 copies)
stresshashfunction map_size=256 stride=1: 160.1ns/insertion
stresshashfunction map_size=256 stride=256: 200.1ns/insertion
stresshashfunction map_size=1024 stride=1: 160.1ns/insertion
stresshashfunction map_size=1024 stride=1024: 160.1ns/insertion
gold_hash_map (4 byte objects, 1000000 iterations):
map_grow 200.0 ns ( 1000000 hashes, 2000000 copies)
map_predict/grow 200.0 ns ( 1000000 hashes, 2000000 copies)
map_replace 90.0 ns ( 2000000 hashes, 3000000 copies)
map_fetch_random 200.0 ns ( 2000000 hashes, 2000000 copies)
map_fetch_sequential 70.0 ns ( 2000000 hashes, 2000000 copies)
map_fetch_empty 50.0 ns ( 1000000 hashes, 0 copies)
map_remove 110.0 ns ( 2000000 hashes, 2000000 copies)
map_toggle 190.0 ns ( 2000000 hashes, 2000000 copies)
stresshashfunction map_size=256 stride=1: 200.1ns/insertion
stresshashfunction map_size=256 stride=256: 280.2ns/insertion
stresshashfunction map_size=1024 stride=1: 200.1ns/insertion
stresshashfunction map_size=1024 stride=1024: 160.1ns/insertion
STANDARD MAP (4 byte objects, 1000000 iterations):
map_grow 960.0 ns ( 0 hashes, 2000000 copies)
map_predict/grow 950.0 ns ( 0 hashes, 2000000 copies)
map_replace 660.0 ns ( 0 hashes, 2000000 copies)
map_fetch_random 1360.0 ns ( 0 hashes, 2000000 copies)
map_fetch_sequential 720.0 ns ( 0 hashes, 2000000 copies)
map_fetch_empty 50.0 ns ( 0 hashes, 0 copies)
map_remove 790.0 ns ( 0 hashes, 2000000 copies)
map_toggle 390.0 ns ( 0 hashes, 2000000 copies)
SPARSE_HASH_MAP (8 byte objects, 500000 iterations):
map_grow 1860.0 ns ( 1338843 hashes, 2838889 copies)
map_predict/grow 760.0 ns ( 500000 hashes, 2000005 copies)
map_replace 360.0 ns ( 1838843 hashes, 2838889 copies)
map_fetch_random 720.0 ns ( 1838843 hashes, 2838889 copies)
map_fetch_sequential 760.0 ns ( 1838843 hashes, 2838889 copies)
map_fetch_empty 380.0 ns ( 0 hashes, 1 copies)
map_remove 1140.0 ns ( 1838843 hashes, 3338889 copies)
map_toggle 2340.0 ns ( 1019999 hashes, 2579997 copies)
stresshashfunction map_size=256 stride=1: 2801.6ns/insertion
stresshashfunction map_size=256 stride=256: 1761.0ns/insertion
stresshashfunction map_size=1024 stride=1: 5042.9ns/insertion
stresshashfunction map_size=1024 stride=1024: 5443.1ns/insertion
DENSE_HASH_MAP (8 byte objects, 500000 iterations):
map_grow 680.0 ns ( 1024287 hashes, 4621515 copies)
map_predict/grow 300.0 ns ( 500000 hashes, 3048619 copies)
map_replace 200.0 ns ( 1524287 hashes, 4621515 copies)
map_fetch_random 200.0 ns ( 1524287 hashes, 4621515 copies)
map_fetch_sequential 180.0 ns ( 1524287 hashes, 4621515 copies)
map_fetch_empty 60.0 ns ( 0 hashes, 35 copies)
map_remove 380.0 ns ( 1524287 hashes, 5121515 copies)
map_toggle 980.0 ns ( 1031249 hashes, 3749995 copies)
stresshashfunction map_size=256 stride=1: 1360.8ns/insertion
stresshashfunction map_size=256 stride=256: 480.3ns/insertion
stresshashfunction map_size=1024 stride=1: 2481.4ns/insertion
stresshashfunction map_size=1024 stride=1024: 1440.8ns/insertion
STANDARD HASH_MAP (8 byte objects, 500000 iterations):
map_grow 300.0 ns ( 1005289 hashes, 2000000 copies)
map_predict/grow 260.0 ns ( 500000 hashes, 2000000 copies)
map_replace 80.0 ns ( 1505289 hashes, 2000000 copies)
map_fetch_random 200.0 ns ( 1505289 hashes, 2000000 copies)
map_fetch_sequential 120.0 ns ( 1505289 hashes, 2000000 copies)
map_fetch_empty 100.0 ns ( 500000 hashes, 0 copies)
map_remove 140.0 ns ( 1505289 hashes, 2000000 copies)
map_toggle 360.0 ns ( 1000000 hashes, 2000000 copies)
stresshashfunction map_size=256 stride=1: 160.1ns/insertion
stresshashfunction map_size=256 stride=256: 240.1ns/insertion
stresshashfunction map_size=1024 stride=1: 240.1ns/insertion
stresshashfunction map_size=1024 stride=1024: 240.1ns/insertion
gold_hash_map (8 byte objects, 500000 iterations):
map_grow 240.0 ns ( 500000 hashes, 1000000 copies)
map_predict/grow 280.0 ns ( 500000 hashes, 1000000 copies)
map_replace 100.0 ns ( 1000000 hashes, 1500000 copies)
map_fetch_random 200.0 ns ( 1000000 hashes, 1000000 copies)
map_fetch_sequential 100.0 ns ( 1000000 hashes, 1000000 copies)
map_fetch_empty 60.0 ns ( 500000 hashes, 0 copies)
map_remove 160.0 ns ( 1000000 hashes, 1000000 copies)
map_toggle 220.0 ns ( 1000000 hashes, 1000000 copies)
stresshashfunction map_size=256 stride=1: 240.1ns/insertion
stresshashfunction map_size=256 stride=256: 80.0ns/insertion
stresshashfunction map_size=1024 stride=1: 160.1ns/insertion
stresshashfunction map_size=1024 stride=1024: 160.1ns/insertion
STANDARD MAP (8 byte objects, 500000 iterations):
map_grow 1020.0 ns ( 0 hashes, 1000000 copies)
map_predict/grow 940.0 ns ( 0 hashes, 1000000 copies)
map_replace 640.0 ns ( 0 hashes, 1000000 copies)
map_fetch_random 1260.0 ns ( 0 hashes, 1000000 copies)
map_fetch_sequential 640.0 ns ( 0 hashes, 1000000 copies)
map_fetch_empty 80.0 ns ( 0 hashes, 0 copies)
map_remove 740.0 ns ( 0 hashes, 1000000 copies)
map_toggle 420.0 ns ( 0 hashes, 1000000 copies)
SPARSE_HASH_MAP (16 byte objects, 250000 iterations):
map_grow 1960.0 ns ( 669412 hashes, 1419455 copies)
map_predict/grow 880.0 ns ( 250000 hashes, 1000005 copies)
map_replace 400.0 ns ( 919412 hashes, 1419455 copies)
map_fetch_random 880.0 ns ( 919412 hashes, 1419455 copies)
map_fetch_sequential 680.0 ns ( 919412 hashes, 1419455 copies)
map_fetch_empty 360.0 ns ( 0 hashes, 1 copies)
map_remove 1160.0 ns ( 919412 hashes, 1669455 copies)
map_toggle 2240.0 ns ( 509999 hashes, 1289997 copies)
DENSE_HASH_MAP (16 byte objects, 250000 iterations):
map_grow 760.0 ns ( 512142 hashes, 2310787 copies)
map_predict/grow 360.0 ns ( 250000 hashes, 1524331 copies)
map_replace 200.0 ns ( 762142 hashes, 2310787 copies)
map_fetch_random 200.0 ns ( 762142 hashes, 2310787 copies)
map_fetch_sequential 240.0 ns ( 762142 hashes, 2310787 copies)
map_fetch_empty 80.0 ns ( 0 hashes, 35 copies)
map_remove 400.0 ns ( 762142 hashes, 2560787 copies)
map_toggle 1000.0 ns ( 515624 hashes, 1874995 copies)
STANDARD HASH_MAP (16 byte objects, 250000 iterations):
map_grow 360.0 ns ( 499010 hashes, 1000000 copies)
map_predict/grow 280.0 ns ( 250000 hashes, 1000000 copies)
map_replace 120.0 ns ( 749010 hashes, 1000000 copies)
map_fetch_random 240.0 ns ( 749010 hashes, 1000000 copies)
map_fetch_sequential 120.0 ns ( 749010 hashes, 1000000 copies)
map_fetch_empty 120.0 ns ( 250000 hashes, 0 copies)
map_remove 200.0 ns ( 749010 hashes, 1000000 copies)
map_toggle 440.0 ns ( 500000 hashes, 1000000 copies)
gold_hash_map (16 byte objects, 250000 iterations):
map_grow 320.0 ns ( 250000 hashes, 500000 copies)
map_predict/grow 280.0 ns ( 250000 hashes, 500000 copies)
map_replace 160.0 ns ( 500000 hashes, 750000 copies)
map_fetch_random 200.0 ns ( 500000 hashes, 500000 copies)
map_fetch_sequential 120.0 ns ( 500000 hashes, 500000 copies)
map_fetch_empty 80.0 ns ( 250000 hashes, 0 copies)
map_remove 160.0 ns ( 500000 hashes, 500000 copies)
map_toggle 280.0 ns ( 500000 hashes, 500000 copies)
STANDARD MAP (16 byte objects, 250000 iterations):
map_grow 1000.0 ns ( 0 hashes, 500000 copies)
map_predict/grow 880.0 ns ( 0 hashes, 500000 copies)
map_replace 640.0 ns ( 0 hashes, 500000 copies)
map_fetch_random 1040.0 ns ( 0 hashes, 500000 copies)
map_fetch_sequential 560.0 ns ( 0 hashes, 500000 copies)
map_fetch_empty 80.0 ns ( 0 hashes, 0 copies)
map_remove 760.0 ns ( 0 hashes, 500000 copies)
map_toggle 440.0 ns ( 0 hashes, 500000 copies)
SPARSE_HASH_MAP (256 byte objects, 31250 iterations):
map_grow 5760.0 ns ( 83659 hashes, 177443 copies)
map_predict/grow 1920.0 ns ( 31250 hashes, 125005 copies)
map_replace 1280.0 ns ( 114909 hashes, 177443 copies)
map_fetch_random 1600.0 ns ( 114909 hashes, 177443 copies)
map_fetch_sequential 1600.0 ns ( 114909 hashes, 177443 copies)
map_fetch_empty 320.0 ns ( 0 hashes, 1 copies)
map_remove 2560.0 ns ( 114909 hashes, 208693 copies)
map_toggle 3840.0 ns ( 63749 hashes, 161247 copies)
DENSE_HASH_MAP (256 byte objects, 31250 iterations):
map_grow 2880.0 ns ( 64013 hashes, 288883 copies)
map_predict/grow 1280.0 ns ( 31250 hashes, 190579 copies)
map_replace 1280.0 ns ( 95263 hashes, 288883 copies)
map_fetch_random 960.0 ns ( 95263 hashes, 288883 copies)
map_fetch_sequential 960.0 ns ( 95263 hashes, 288883 copies)
map_fetch_empty 320.0 ns ( 0 hashes, 35 copies)
map_remove 1280.0 ns ( 95263 hashes, 320133 copies)
map_toggle 2560.0 ns ( 64453 hashes, 234405 copies)
STANDARD HASH_MAP (256 byte objects, 31250 iterations):
map_grow 2880.0 ns ( 91756 hashes, 125000 copies)
map_predict/grow 1280.0 ns ( 31250 hashes, 125000 copies)
map_replace 960.0 ns ( 123006 hashes, 125000 copies)
map_fetch_random 960.0 ns ( 123006 hashes, 125000 copies)
map_fetch_sequential 960.0 ns ( 123006 hashes, 125000 copies)
map_fetch_empty 960.0 ns ( 31250 hashes, 0 copies)
map_remove 960.0 ns ( 123006 hashes, 125000 copies)
map_toggle 1920.0 ns ( 62500 hashes, 125000 copies)
gold_hash_map (256 byte objects, 31250 iterations):
map_grow 1280.0 ns ( 31250 hashes, 31250 copies)
map_predict/grow 1280.0 ns ( 31250 hashes, 31250 copies)
map_replace 1280.0 ns ( 62500 hashes, 31250 copies)
map_fetch_random 960.0 ns ( 62500 hashes, 31250 copies)
map_fetch_sequential 960.0 ns ( 62500 hashes, 31250 copies)
map_fetch_empty 960.0 ns ( 31250 hashes, 0 copies)
map_remove 960.0 ns ( 62500 hashes, 31250 copies)
map_toggle 2240.0 ns ( 62500 hashes, 31250 copies)
STANDARD MAP (256 byte objects, 31250 iterations):
map_grow 640.0 ns ( 0 hashes, 62500 copies)
map_predict/grow 640.0 ns ( 0 hashes, 62500 copies)
map_replace 320.0 ns ( 0 hashes, 62500 copies)
map_fetch_random 640.0 ns ( 0 hashes, 62500 copies)
map_fetch_sequential 640.0 ns ( 0 hashes, 62500 copies)
map_fetch_empty 0.0 ns ( 0 hashes, 0 copies)
map_remove 640.0 ns ( 0 hashes, 62500 copies)
map_toggle 640.0 ns ( 0 hashes, 62500 copies)
分享到:
相关推荐
《C++ Sparse Map:高效的哈希映射与集合实现解析》 在计算机科学中,数据结构的选择对于程序的性能有着至关重要的影响。特别是在C++这样的系统级编程语言中,高效的数据结构更是程序员们的得力助手。本文将深入...
**Nginx与url_hash插件** Nginx是一个高性能的HTTP和反向代理服务器,以其轻量级、高并发处理能力以及丰富的模块扩展性而闻名。然而,Nginx本身并不内置支持url_hash功能,这是一个用于负载均衡的策略,通过将特定...
《gen_lex_hash_pc:MySQL交叉编译的关键工具详解》 在IT行业中,数据库管理系统是核心组件之一,而MySQL作为开源关系型数据库的代表,广泛应用于各类项目中。在特定环境下,如嵌入式设备或资源有限的PC平台,我们...
标题 "UMAT_Hashin3D_hashin" 指涉的是一个专门针对复合材料损伤分析的三维子程序,该程序基于Hashin破坏准则。在有限元分析(FEA)中,用户自定义材料(User-Defined Material,UMAT)是实现特定材料行为建模的一种...
《Nginx Upstream Hash模块详解与应用》 在Web服务器领域,Nginx以其高效、轻量级的特性赢得了广泛的应用。为了实现更灵活的负载均衡策略,Nginx提供了一系列的upstream模块,其中,`nginx_upstream_hash`模块是...
在本文中,我们将深入探讨如何在Nginx服务器上配置URL哈希(url_hash)转发方式,这是一种负载均衡策略,用于将特定的URL请求路由到特定的后端服务器。这种配置适用于需要根据URL保持会话状态的应用场景,比如动态...
"ngx_http_consistent_hash-master.zip" 是一个与 Nginx Web服务器相关的压缩包文件,其中包含了一个名为 "ngx_http_consistent_hash" 的第三方模块的源代码。"master" 指示这可能是该模块的主分支或最新版本。 **...
jg :: dense_hash_map 一个简单的std::unordered_map替代品,具有更好的性能,但失去了稳定的寻址方式,这是一种折衷方案。 在此处查看此哈希图的详细说明: : 生成状态: 特拉维斯(Travis):
这个压缩包文件“基于应变和应力的Vumat子程序_hashin失效准则_动态应变_拉伸失效_hashin_vumat.zip”显然包含了与使用Vumat子程序来模拟材料失效,特别是Hashin失效准则相关的资料,以及动态应变和拉伸失效的应用。...
Google的哈希map性能和内存目前是最优的。 我在电信行业和信息安全行业里的工作经历发现,目前网络上的哈希算法都在查询速度上远远无法满足日趋增长的网络大数据要求。因此产生了自己写算法的想法。 现在我把自己...
3. `concurrent_hash_map`:这是一个线程安全的哈希映射,允许并发的读写操作。它在多线程环境下提供高效的数据查找和更新,同时确保数据一致性。 相比于传统的STL容器,TBB并发容器的优势在于它们在设计时考虑了多...
标题 "STATUS_INVALID_IMAGE_HASH.zip" 暗示了一个与操作系统或浏览器有关的错误,特别是针对Chrome和Edge浏览器。这个问题通常涉及到系统中某个可执行文件(DLL或EXE)的哈希值与预期不符,导致安全策略无法验证其...
在获取到mysql用户的hash后, 可用hash直接登陆mysql进行操作 比如我们注入出数据库的hash,但是没办法拿到webshell 我们可以使用mysql_hash,用hash登陆并控制数据库 使用方法: mysql_hash.exe -u root -p Enter ...
《深入解析nginx_upstream_hash模块:打造高效负载均衡策略》 在互联网服务中,nginx作为一款高性能的HTTP和反向代理服务器,广泛应用于各种复杂的网络架构中。为了满足动态负载均衡的需求,nginx提供了丰富的...
在IT领域,哈希表(Hash Map)是一种高效的数据结构,尤其在处理大数据时,它的作用至关重要。"pwwHash.zip_Big!_hash map"这个文件标题暗示了这是一个关于大规模数据处理和哈希映射的专题,可能包含了某种特定的...
在本项目中,"md5_hash.rar_hash_md5_hash" 的标题暗示了这是一个关于C++实现MD5哈希算法的工程。描述中的 "C++ implementation for md5" 进一步确认了这个项目的焦点。标签"hash"和"md5_hash"也与哈希计算相关。 ...
【渗透技巧_Pass_the_Hash_with_Exchange_Web_Service1】这篇文章主要讲解了如何通过Exchange Web Service (EWS)利用NTLM Hash进行无密码登录的渗透测试技术,即Pass the Hash攻击的一种变种。Pass the Hash是一种...
而"hash"策略则是Nginx upstream模块中的一个功能,用于根据特定的请求属性(例如URL)来决定请求应被转发到哪个后端服务器。 在标题和描述中提到的"Nginx_upstream_hash-0.3.1.tar.gz"是一个Nginx的第三方模块,它...
标题中的"vuamt and umat_hashin_UMAT_Hashin_umathashin_vumat_"提到了几个关键术语,它们都是在材料力学和有限元分析(FEA)领域中的重要概念。在这里,我们主要讨论的是"UMAT"、"Hashin damage"以及"umat_hashin...