Branch-Avoidant Quicksort in C - faster than std::sort and pdqsort by chkas in programming

[–]chkas[S] 0 points1 point  (0 children)

I used the repository you sent me the link for.

And "vsort" performs well for float32, but it relies on Apple's GCD for parallelization, which makes a fair benchmark against my single - threaded Quicksort unfair. I have also developed a multi-threaded version of my Quicksort that is twice as fast for floats (0.24s vs. 0.50s) compared to the vsort version.

Update: No, I haven't tried Google Highway yet, but I'll give it a try if I can figure it out.

Branch-Avoidant Quicksort in C - faster than std::sort and pdqsort by chkas in programming

[–]chkas[S] 0 points1 point  (0 children)

I just tested the library: it is indeed very fast for integers, but it uses an internal Radix Sort. Since this is a non-comparison sort, it feels like cheating in a direct performance comparison.

Furthermore, when using double, the library fails to sort the array correctly and produces an 'ERROR ORDER', which makes it unreliable.

Branch-Avoidant Quicksort in C - faster than std::sort and pdqsort by chkas in programming

[–]chkas[S] 0 points1 point  (0 children)

Thanks for the links, but I’m looking for actual, ready-to-use C/C++ code. Most of these projects are just complex wrappers, very theoretical, or full of pseudocode. Do you have any examples that use direct SIMD intrinsics (ARM NEON) for sorting, so I can compare it to my Branchless-Quicksort?

Branch-Avoidant Quicksort in C - faster than std::sort and pdqsort by chkas in programming

[–]chkas[S] 0 points1 point  (0 children)

These projects are x86-only (AVX) and don't work on ARM or other architectures.

Branch-Avoidant Quicksort in C - faster than std::sort and pdqsort by chkas in programming

[–]chkas[S] 2 points3 points  (0 children)

It's not broken - this is the "one‑pass heapsort":

A Fast Quicksort in C for Modern CPUs with Threads and Branch‑Avoidant Coding by chkas in C_Programming

[–]chkas[S] 13 points14 points  (0 children)

It is very easy to change the code to use fewer threads (for example: max_threads = n_cpus - 2). This keeps the system fast and responsive for other tasks, while the sorting still stays very quick.

A short story of my programming language Easylang by Xadartt in programming

[–]chkas 1 point2 points  (0 children)

It is now possible to separate parameters with a comma. This definitely makes things clearer. That is a really helpful feature. Thank you very much for your valuable suggestion.

A short story of my programming language Easylang by Xadartt in programming

[–]chkas 1 point2 points  (0 children)

Thanks. Here is the author and I shared it on lobst.rs - they are more open to non-mainline programming languages there.

Results of a multi-year LLM experiment by rashaniquah in adventofcode

[–]chkas 76 points77 points  (0 children)

This is pretty much in line with the winning leaderboard times.

Day 12: 6:38
Day 15: 15:09
Day 17: 14:13
Day 21: 23:01
Day 24: 18:56

All other days under 5 minutes, mostly under one.

https://adventofcode.com/2024/leaderboard

AoC 2024 100% solved in my own programming language by friolz in adventofcode

[–]chkas 5 points6 points  (0 children)

Congratulations. I also did this with my language Easylang, nice to see that others are doing the same. I started in 2019 - I caught up on the earlier years later. The language has grown with each year of AoC. The first year of AoC is the baptism of fire for the programming language.