C Sort

Open-source C projects categorized as Sort

Top 7 C Sort Projects

  • C

    Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.

  • Klib

    A standalone and lightweight C library

  • Project mention: Factor is faster than Zig | news.ycombinator.com | 2023-11-10

    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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • quadsort

    Quadsort is a branchless stable adaptive mergesort faster than quicksort.

  • Project mention: 10~17x faster than what? A performance analysis of Intel x86-SIMD-sort (AVX-512) | news.ycombinator.com | 2023-06-10

    https://github.com/scandum/quadsort/blob/f171a0b26cf6bd6f6dc...

    As you can see, quadsort 1.1.4.1 used 2 instead of 4 writes in the bi-directional parity merges. This was in June 2021, and would have compiled as branchless with clang, but as branched with gcc.

    When I added a compile time check to use ternary operations for clang I was not adapting your work. I was well aware that clang compiled ternary operations as branchless, but I wasn't aware that rust did as well. I added the compile time check to use ternary operations for a fair performance comparison against glidesort.

    https://raw.githubusercontent.com/scandum/fluxsort/main/imag...

    As for ipnsort's small sort, it is very similar to quadsort's small sort, which uses stable sorting networks, instead of unstable sorting networks. From my perspective it's not exactly novel. I didn't go for unstable sorting networks in crumsort to increase code reuse, and to not reduce adaptivity.

  • blitsort

    Blitsort is an in-place stable adaptive rotate mergesort / quicksort.

  • crumsort

    A branchless unstable quicksort / mergesort that is highly adaptive.

  • rhsort

    Robin Hood Sort, for uniform data

  • Project mention: Need a Quick Favor: Help a Student with a Simple Click! | /r/github | 2023-11-19

    I’m in the midst of a class project that requires a GitHub repository with over 100 stars. It’s one of the key criteria I need to meet, and I’m almost there. The repo I’ve been contributing to is https://github.com/mlochbaum/rhsort , which aligns perfectly with my project's needs—except it’s a bit short on stars.

  • combsort.h

    optimized combsort macro

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

C Sort related posts

  • Need a Quick Favor: Help a Student with a Simple Click!

    1 project | /r/github | 19 Nov 2023
  • Doubt regarding counting sort

    2 projects | /r/algorithms | 12 Jun 2023
  • Fluxsort: A stable quicksort, now faster than Timsort for both random and ordered data

    2 projects | /r/programming | 4 Feb 2023
  • Show HN: QuadSort, Esoteric Fast Sort

    1 project | /r/hypeurls | 29 Jan 2023
  • Show HN: QuadSort, Esoteric Fast Sort

    4 projects | news.ycombinator.com | 28 Jan 2023
  • When does big-oh notation become not helpful when comparing algorithms?

    1 project | /r/learnprogramming | 7 Dec 2022
  • I can’t believe that I can prove that it can sort

    2 projects | news.ycombinator.com | 4 Jul 2022
  • A note from our sponsor - SaaSHub
    www.saashub.com | 10 May 2024
    SaaSHub helps you find the best software and product alternatives Learn more →

Index

What are some of the best open-source Sort projects in C? This list will help you:

Project Stars
1 C 18,138
2 Klib 4,031
3 quadsort 2,107
4 blitsort 699
5 crumsort 315
6 rhsort 69
7 combsort.h 0

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com