robin-hood-hashing VS CPython

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

robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 (by martinus)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
robin-hood-hashing CPython
23 1,314
1,465 59,531
- 1.6%
0.0 10.0
12 months ago 5 days ago
C++ Python
MIT License GNU General Public License v3.0 or later
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.

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.

CPython

Posts with mentions or reviews of CPython. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-25.
  • scrape-yahoo-finance
    3 projects | dev.to | 25 Apr 2024
    Web Scraping Tool Development: Develop a Python based web scraping tool capable of extracting data from targeted web pages on Yahoo Finance and presenting the data extracted in a readable format. Our target site relies on AJAX to load and update the data dynamically so we will need a tool that is capable of processing JavaScript.
  • Employee Management System using Python.
    2 projects | dev.to | 21 Apr 2024
    Dealing with piles of papers or scattered Excel sheets for employee information can be a real headache, right? Well, what if I told you there's a smoother way to handle all that? A system that lets you easily store, update, and find details about your employees in just a few clicks. Sounds neat, doesn't it? In this article, we're going to explore creating an employee management system using Python, Tkinter, and SQLite3.
  • Build a Product Receipt Generator using Python.
    1 project | dev.to | 20 Apr 2024
    Python is a versatile tool, and today we're delving into a practical use case that can simplify your daily routines. With the datetime module at your disposal, handling dates and times becomes a breeze, making it perfect for crafting accurate and dynamic product receipts. Whether you're a seasoned Python pro or just starting your coding journey, this article will guide you through each step with ease.
  • Build a Music Player with Python
    2 projects | dev.to | 20 Apr 2024
    When working in Visual Studio Code (VS Code), create a new Python file for our music player project. It's helpful to have separate files for different parts of your project.
  • PEP 744 – JIT Compilation
    1 project | news.ycombinator.com | 18 Apr 2024
    > It provides a meaningful performance improvement for at least one popular platform (realistically, on the order of 5%).

    At first it will not provide a large boost, but it will set the foundations for larger gains in subsequent releases. They link a list of some proposed improvements already underway, with improvement estimates, at https://github.com/python/cpython/issues/115802

  • Featured Mod of the Month: Phil Ashby
    2 projects | dev.to | 16 Apr 2024
    After that, with the basics of software engineering understood, I would move on to a wider use language, with a bigger ecosystem to employ, most likely Python. This would expose me to large system design / distributed systems and architectural challenges...
  • Convert Images Into Pencil Sketch
    2 projects | dev.to | 11 Apr 2024
    Have you ever felt like your photos needed a little extra touch to stand out? Well, get ready because we're about to learn a cool Python trick! We're going to take ordinary photos and turn them into awesome pencil sketches using Python and OpenCV. This will make your pictures look like they were drawn by hand!
  • Crafting an Image to PDF Converter App Using Python
    1 project | dev.to | 11 Apr 2024
    Have you ever found yourself in a situation where you needed to convert a bunch of images into a PDF file quickly and efficiently? Imagine the convenience of converting a series of images from your recent trip into a single PDF album with just a few clicks. In this article, we will cover the process of building an Image PDF Converter App using Python. With the help of libraries like tkinter, os, and Python Imaging Library (PIL), we'll walk through the process of creating a powerful tool that can streamline this task for you.
  • Calculator with GUI Using Python Tkinter
    1 project | dev.to | 11 Apr 2024
    If you've ever wanted to learn how to use Python or if you already know a bit and want to try something new, then you're in the right place! In this article, we'll show you step-by-step how to make your very own calculator using Python's Tkinter library, a renowned Python library for creating graphical user interfaces. Tkinter stands out for its simplicity, versatility, and widespread use in the Python community. It doesn't matter if you're a total beginner or an experienced coder looking for a fun project, we'll guide you through everything you need to know.
  • Back to Basics - Pandas #1
    1 project | dev.to | 9 Apr 2024
    Pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.

What are some alternatives?

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

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

RustPython - A Python Interpreter written in Rust

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

ipython - Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

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

Vulpix - Fast, unopinionated, minimalist web framework for .NET core inspired by express.js

xxHash - Extremely fast non-cryptographic hash algorithm

Visual Studio Code - Visual Studio Code

C++ Format - A modern formatting library

Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE - Do you want to LEARN NEW STUFF for FREE? Don't worry, with the power of web-scraping and automation, this script will find the necessary Udemy coupons & enroll you for PAID UDEMY COURSES, ABSOLUTELY FREE!

tracy - Frame profiler

Pandas - Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more