boost VS robin-hood-hashing

Compare boost vs robin-hood-hashing and see what are their differences.

boost

My personal boost mirror to be submoduled by my projects (by darwin)

robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 (by martinus)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
boost robin-hood-hashing
17 23
1 1,465
- -
10.0 0.0
over 13 years ago 12 months ago
C++ C++
Boost Software License 1.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

boost

Posts with mentions or reviews of boost. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-18.
  • Inside boost::unordered_flat_map
    11 projects | /r/cpp | 18 Nov 2022
  • coost v3.0.0 released - A tiny boost library in C++11
    2 projects | /r/cpp | 8 Sep 2022
    coost is a cross-platform C++ basic library with both performance and ease of use. It is like boost, but much smaller, the static library built on linux and mac is only about 1MB in size. Although small, it provides enough powerful features:
  • Ask HN: Is ease in getting started the key for Python's success?
    2 projects | news.ycombinator.com | 9 Aug 2022
    Not so much ease, as flexibility.

    In the end, the thing that matters the most for software is being able to get logic into code as efficiently as possible. This includes being able to write concise code, being able to execute it and see results, debug it efficiently, use libraries easily, and deploy it to production. Python has all of this.

    The rest of the stuff, like strong typing, memory safety, e.t.c are at best academic. The supposed advantages of those just don't hold up once you start to look into the real world. Linux, which runs on most devices that support an os hardware wise, is written purely in C. Python is used as a backend for very big projects like Youtube, Instagram, Spotify, e.t.c. Its also used to run Openpilot (https://github.com/commaai/openpilot), which has performance on par with Teslas autopilot.

    Meanwhile in Java world, with strict typing, you have egregious vulnerabilities like log4shell, amongst others (https://java-0day.com/).

    Language evolution is also a thing to look at with this stuff. The more "strict" you try to make a language, the worse its going to become as people are necessarily going to find hacks around it. With java, type safety strict features like having getters and setters get abstracted away behind an annotation processor that hacks the AST (Lombok), and thats not only considered ok, but is encouraged to be used. With C++, template metaprogramming got extremely out of hand with https://www.boost.org/, where the error messages for one thing used to be pages long. Rust manage to sneak this under the radar with the unsafe clause, which is going to see standard use in many codebases, thus negating any of its advantages.

    In the end, good code comes from good developers, full stop. Every codebase will necessarily have tests for production deployment, and anything that language features don't catch during compilation or static checking can be checked with testing if you have developers that understand what they are doing and can write appropriate testing frameworks.

    And based on that, its pretty attractive to use Python especially when you consider developer time. And the flexibility means you can write your code in different forms to suit your use case, where it be OOP with MyPy type checking, functional, imperative, or super complex if you want.

  • Compile-Time Hash in Plain C (Not Only C++) is Now Possible!
    2 projects | dev.to | 9 Aug 2022
    For those who didn't know what is Boost, it's a C++ library that helps to prevent re-inventing the wheel while trying to program something quite complex as example looping only with macro, Boost Preprocessor. Fortunately, Boost Preprocessor Repeat also works with plain C, not only C++. So, my OrangePi board can calculate hash at compile-time. Unfortunately, my SIX Hash algorithm requires sizeof(input) and Boost... won't... work... with it. Hours of workarounds, no luck.
  • How do I connect a REST API with C++?
    3 projects | /r/cpp_questions | 31 Jul 2022
    If you have the ability to use third-party libraries (though if you can't this project is going to be a nightmare, lol...) I would recommend using the Beast library from the Boost collection of libraries. It's a little bit more verbose than some options, but not that much more, and it's better maintained. REST webservices are built on top of the HTTP framework, so it's just a matter of sending a HTTP GET request to a server (or POST/UPDATE/DELETE, depending on how exactly the api on the other end is implemented) and reading the response you get back. This is a very basic sample of a client sending a GET request to a server. If you need to change this to do a POST (or some other kind of request), there's only two real changes that need to be made:
  • Can anyone explain the differences of Conda vs Pip?
    2 projects | /r/Python | 22 Jul 2022
    The person you replied to used slightly confusing terminology. Conda deals with non-python packages. As in if you wanted to install boost for C++.
  • Looking to download/use Boost
    1 project | /r/cpp_questions | 6 Jul 2022
    I'm not sure if its just me but I'm finding I can't access any of the download links on the Boost Website.
  • Resources for experienced C programmer for C++20/17/13
    4 projects | /r/cpp | 29 Jun 2022
  • How to write reflection for C++
    8 projects | dev.to | 22 Jun 2022
    rich standard library and Boost;
  • Where to read about modern C++ features which you should use?
    2 projects | /r/Cplusplus | 17 Jun 2022
    Boost is also another ubiquitous library. Lots of code that doesn't make it into the standard kind of ends up here. Lots of code that gets into the standard starts here. Boost.Asio might end up being our network API in 23.

robin-hood-hashing

Posts with mentions or reviews of robin-hood-hashing. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-10.
  • Factor is faster than Zig
    11 projects | news.ycombinator.com | 10 Nov 2023
    In my example the table stores the hash codes themselves instead of the keys (because the hash function is invertible)

    Oh, I see, right. If determining the home bucket is trivial, then the back-shifting method is great. The issue is just that it’s not as much of a general-purpose solution as it may initially seem.

    “With a different algorithm (Robin Hood or bidirectional linear probing), the load factor can be kept well over 90% with good performance, as the benchmarks in the same repo demonstrate.”

    I’ve seen the 90% claim made several times in literature on Robin Hood hash tables. In my experience, the claim is a bit exaggerated, although I suppose it depends on what our idea of “good performance” is. See these benchmarks, which again go up to a maximum load factor of 0.95 (Although boost and Absl forcibly grow/rehash at 0.85-0.9):

    https://strong-starlight-4ea0ed.netlify.app/

    Tsl, Martinus, and CC are all Robin Hood tables (https://github.com/Tessil/robin-map, https://github.com/martinus/robin-hood-hashing, and https://github.com/JacksonAllan/CC, respectively). Absl and Boost are the well-known SIMD-based hash tables. Khash (https://github.com/attractivechaos/klib/blob/master/khash.h) is, I think, an ordinary open-addressing table using quadratic probing. Fastmap is a new, yet-to-be-published design that is fundamentally similar to bytell (https://www.youtube.com/watch?v=M2fKMP47slQ) but also incorporates some aspects of the aforementioned SIMD maps (it caches a 4-bit fragment of the hash code to avoid most key comparisons).

    As you can see, all the Robin Hood maps spike upwards dramatically as the load factor gets high, becoming as much as 5-6 times slower at 0.95 vs 0.5 in one of the benchmarks (uint64_t key, 256-bit struct value: Total time to erase 1000 existing elements with N elements in map). Only the SIMD maps (with Boost being the better performer) and Fastmap appear mostly immune to load factor in all benchmarks, although the SIMD maps do - I believe - use tombstones for deletion.

    I’ve only read briefly about bi-directional linear probing – never experimented with it.

  • If this isn't the perfect data structure, why?
    3 projects | /r/C_Programming | 22 Oct 2023
    From your other comments, it seems like your knowledge of hash tables might be limited to closed-addressing/separate-chaining hash tables. The current frontrunners in high-performance, memory-efficient hash table design all use some form of open addressing, largely to avoid pointer chasing and limit cache misses. In this regard, you want to check our SSE-powered hash tables (such as Abseil, Boost, and Folly/F14), Robin Hood hash tables (such as Martinus and Tessil), or Skarupke (I've recently had a lot of success with a similar design that I will publish here soon and is destined to replace my own Robin Hood hash tables). Also check out existing research/benchmarks here and here. But we a little bit wary of any benchmarks you look at or perform because there are a lot of factors that influence the result (e.g. benchmarking hash tables at a maximum load factor of 0.5 will produce wildly different result to benchmarking them at a load factor of 0.95, just as benchmarking them with integer keys-value pairs will produce different results to benchmarking them with 256-byte key-value pairs). And you need to familiarize yourself with open addressing and different probing strategies (e.g. linear, quadratic) first.
  • boost::unordered standalone
    3 projects | /r/cpp | 9 Jul 2023
    Also, FYI there is robin_hood::unordered_{map,set} which has very high performance, and is header-only and standalone.
  • Solving “Two Sum” in C with a tiny hash table
    1 project | news.ycombinator.com | 29 Jun 2023
    std::unordered_map is notoriously slow, several times slower than a "proper" hashmap implementation like Google's absl or Martin's robin-hood-hashing [1]. That said, std::sort is not the fastest sort implementation, either. It is hard to say which will win.

    [1]: https://github.com/martinus/robin-hood-hashing

  • Convenient Containers v1.0.3: Better compile speed, faster maps and sets
    4 projects | /r/C_Programming | 3 May 2023
    The main advantage of the latest version is that it reduces build time by about 53% (GCC 12.1), based on the comprehensive test suit found in unit_tests.c. This improvement is significant because compile time was previously a drawback of this library, with maps and sets—in particular—compiling slower than their C++ template-based counterparts. I achieved it by refactoring the library to do less work inside API macros and, in particular, use fewer _Generic statements, which seem to be a compile-speed bottleneck. A nice side effect of the refactor is that the library can now more easily be extended with the planned dynamic strings and ordered maps and sets. The other major improvement concerns the performance of maps and sets. Here are some interactive benchmarks[1] comparing CC’s maps to two popular implementations of Robin Hood hash maps in C++ (as well as std::unordered_map as a baseline). They show that CC maps perform roughly on par with those implementations.
  • Effortless Performance Improvements in C++: std:unordered_map
    4 projects | news.ycombinator.com | 2 Mar 2023
    For anyone in a situation where a set/map (or unordered versions) is in a hot part of the code, I'd also highly recommend Robin Hood: https://github.com/martinus/robin-hood-hashing

    It made a huge difference in one of the programs I was running.

  • Inside boost::unordered_flat_map
    11 projects | /r/cpp | 18 Nov 2022
  • What are some cool modern libraries you enjoy using?
    32 projects | /r/cpp | 18 Sep 2022
    Oh my bad. Still thought -- your name.. it looks very familiar to me. Are you the robin_hood hashing guy perhaps? Yes you are! My bad -- https://github.com/martinus/robin-hood-hashing.
  • Performance comparison: counting words in Python, C/C++, Awk, Rust, and more
    12 projects | news.ycombinator.com | 24 Jul 2022
    Got a bit better C++ version here which uses a couple libraries instead of std:: stuff - https://gist.github.com/jcelerier/74dfd473bccec8f1bd5d78be5a... ; boost, fmt and https://github.com/martinus/robin-hood-hashing

        $ g++ -I robin-hood-hashing/src/include -O2 -flto -std=c++20 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -lfmt
  • A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion
    5 projects | /r/cpp | 4 Jul 2022
    The implementation is mostly inspired by this comment and lessons learned from my older robin-hood-hashing hashmap.

What are some alternatives?

When comparing boost and robin-hood-hashing you can also consider the following projects:

jackson-databind - General data-binding package for Jackson (2.x): works on streaming API (core) implementation(s)

parallel-hashmap - A family of header-only, very fast and memory-friendly hashmap and btree containers.

coost - A tiny boost library in C++11.

STL - MSVC's implementation of the C++ Standard Library.

cppinsights - C++ Insights - See your source code with the eyes of a compiler

robin-map - C++ implementation of a fast hash map and hash set using robin hood hashing

GSL - Guidelines Support Library

xxHash - Extremely fast non-cryptographic hash algorithm

simdjson - Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

C++ Format - A modern formatting library

restclient-cpp - C++ client for making HTTP/REST requests

tracy - Frame profiler