简体   繁体   English

GHashTable vs std :: tr1 :: unordered_map

[英]GHashTable vs std::tr1::unordered_map

Has anyone experienced with both GHashTable and std::tr1::unordered_map? 有没有人经历过GHashTable和std :: tr1 :: unordered_map? I want to know which one to use and which one is more recommended. 我想知道使用哪一个以及更推荐哪一个。 I couldn't find anything really useful online. 我在网上找不到任何真正有用的东西。

Thanks, 谢谢,

I have a preference for standard library containers and tools when they will work. 我们首选标准库容器和工具。 This makes software more portable. 这使软件更具便携性。 So on that basis I would go with std::tr1::unordered_map or better yet, I would use C++11 and go with std::unordered_map (if you have a suitable compiler and can use C++11) which is essentially the same as the tr1 container but has some additional speedups. 所以在此基础上我会使用std :: tr1 :: unordered_map或者更好,我会使用C ++ 11并使用std :: unordered_map(如果你有一个合适的编译器并且可以使用C ++ 11),这是与tr1容器基本相同,但有一些额外的加速。

Finally, as one can see from the link above from @mfontanini unordered_map is pretty fast compared to many implementations. 最后,正如从上面的链接中可以看到,@ mfontanini unordered_map与许多实现相比非常快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM