Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Interakt, an open-source self-hosted search and AI chat for your website(github.com/alphasolutionsrepo ↗)
    discuss
  2. Gnome 51, "A Coruña"(gnome.org ↗)
    discuss
  3. Artemis II Launch 35mm High Speed Film (01.apr.2026)(nasa.gov ↗)
    discuss
  4. A 3D Rasterizer for Embedded Devices(github.com/cubecoders ↗)
    discuss
  5. Breaking the 1.58-bit Barrier for Ternary LLMs(arxiv.org ↗)
    discuss
  6. 2026 Small World in Motion Competition – Nikon Small World(nikonsmallworld.com ↗)
    discuss
  7. RustFS 1.0.0 GA: Production-Ready, Open Source, S3-Compatible Object Storage(rustfs.com ↗)
    discuss
  8. Zuck's bot increased our Vercel bill 10x
    discuss
  9. How VoltDB Works(voltdb.com ↗)
    discuss
  10. Ask HN: People unemployed for >2 years, how do you spend your time?
    1comments
  11. Ukrainian USV Attack on Sochi Reveals Rarely Seen Russian Navy Trained Dolphins(hisutton.com ↗)
    discuss
  12. Copyrightability of LLM-Generated Code(fsfe.org ↗)
    discuss
  13. I'm getting sued by a data center(technically.beehiiv.com ↗)
    discuss
  14. Trump's war on EVs derailed America's auto-factory revival(indiatimes.com ↗)
    discuss
  15. Show HN: A simple Mac extension for recent screenshots(github.com/kanishkvashisht ↗)
    1comments
  16. Everything we know about good agent design(rubriclabs.com ↗)
    discuss
  17. R/DoohickeyCorporation(reddit.com ↗)
    1comments
  18. WASM to Go Source Code(github.com/goccy ↗)
    discuss
  19. Ask HN: How would you anthropomorphize the Anthropic Claude logo?
    discuss
  20. Automattic's interim CEO and legal chief signed reciprocal severance deals(techcrunch.com ↗)
    1comments
  21. Arrow 2 and Arrow 2 Telos(quiver.ai ↗)
    discuss
  22. History of Forgotten Chips [video](youtube.com ↗)
    discuss
  23. An air taxi that floats: Regent's Seaglider takes flight with people on board(smartcitiesdive.com ↗)
    discuss
  24. Brushstrokes: Avant-Garde and the Psychology of Perception(eclecticlight.co ↗)
    discuss
  25. The Rhythm of Your Breath Leaves a Fingerprint on Your Thoughts(nautil.us ↗)
    discuss
  26. New satellites and artificial intelligence are transforming wildfire detection(theguardian.com ↗)
    discuss
  27. How to use HDR brightness as a graphic design hack(hdrlogo.com ↗)
    1comments
  28. DOE vs. GitHub, INC: LLM generated-content not a DMCA violation [pdf](uscourts.gov ↗)
    discuss
  29. Racing driver is about to race 100 karts at once(arstechnica.com ↗)
    discuss
  30. What's New in PHP 8.6(laravel-news.com ↗)
    1comments

Vectorized and performance-portable Quicksort (2022)

147 pointsby 2h agoopensource.googleblog.com
18 comments
2h agoHN ↗

Very nice. Let's see Paul Allen's quicksort

2h agoHN ↗

(2022)

If you're curious why you would want a vectorized way to sort lists of numbers, one use case is building histograms - it's much easier to build a histogram if you've sorted all your samples first

1h agoHN ↗

(2002)

I wonder what apps have implemented this now that a few years have passed.

1h agoHN ↗

Actual title: “Vectorized and performance-portable Quicksort” (2022).

Actual sense in which it’s first:

Happily, modern instruction sets (Arm SVE, RISC-V V, x86 AVX-512) include a special instruction suitable for partitioning. Given a separate input of yes/no values (whether an element is less than the pivot), this "compress-store" instruction stores to consecutive memory only the elements whose corresponding input is "yes". We can then logically negate the yes/no values and apply the instruction again to write the elements to the other partition. This strategy has been used in an AVX-512-specific Quicksort. But what about other instruction sets such as AVX2 that don't have compress-store? Previous work has shown how to emulate this instruction using permute instructions.

We build on these techniques to achieve the first vectorized Quicksort that is portable to six instruction sets across three architectures, and in fact outperforms prior architecture-specific sorts.

1h agoHN ↗

Our implementation uses Highway's portable SIMD functions, so we do not have to re-implement about 3,000 lines of C++ for each platform.

Would they do the same thing today or have an LLM re-implement those 3000 lines of c++ ?

1h agoHN ↗

Id say that it is a lot more likely for the in-house, at least half a decade old library to be correct and performant than 3000 lines of an LLMs mediocre regurgitation of that code.

1h agoHN ↗

Guys, remember when language features allowed re-usability?

49m agoHN ↗

Barely, and rarely for C++ specifically.

I think software engineering in general is in a bit of a discoverability crisis. So many problems actually have solutions implemented... Somewhere. If you know about them. And are speaking the same vocabulary as the original implementer to realize the solution might be applicable to your problem. It's one of the reasons that jokes exist about microservice frameworks (https://www.youtube.com/watch?v=y8OnoxKotPQ) and how "We use Hadoop to store the output from our Kafka pipe, that's populated from our Traefik layer, all monitored with Grafana in front of Loki and Prometheus, of course" is a real sentence that has actual meaning and not a fever-dream.

LLMs are actually pretty impressive at being able to pull together disparate information from various domains into one place.

1h agoHN ↗

Well, it came out a while ago, so maybe we can be a bit silly:

There’s something sort of beautiful about mergesort and heapsort. Their names tell you what their main idea is, and how they work is immediately obvious.

Quicksort, on the other hand, has nothing beautiful about it and is named after it’s one redeeming feature (that it is quick for a lot of cases).

1h agoHN ↗

The beauties of quicksort are that it sorts in-place and that it is embarrassingly simple.

The in-place property can be utilized to make it very close to cache-oblivious algorithm.

1h agoHN ↗

How is it less beautiful?

Honest question, curious to hear about what that means to you.

1h agoHN ↗

Maybe if Hoare had called it Partitionsort in 1960, the name wouldn’t have been memorable enough to catch on and become so popular.

1h agoHN ↗

Definitely needs (2022) in the title, I was a bit confused!

1h agoHN ↗

only sorts numbers? wouldn't radix be much better?

1h agoHN ↗

Just imagine when candidates will get asked by pre-revenue startups to implement a vectorized version of quick-sort in person in 10 mins, just for a SWE job which they do not use this themselves.

Only the likes of MAG 7, and a couple of hedge-funds would ask to do it since this problem directly applies to them.

But certainly not pre-revenue startups.

1h agoHN ↗

this was made like 4 years back most of the current algorithms use this already !

38m agoHN ↗

I didn't like the 9 MB image file in the blog. It took me few seconds to fully render the image.