15 comments

  • minitech 20 minutes ago

    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.

  • bee_rider 13 minutes ago

    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).

  • zX41ZdbW 7 minutes ago

    Strange to see it here, the article is quite old.

    Since pdqsort, vqsort, and glide sort, the current state-of-the-art are driftsort and ipnsort.

    I've integrated them into ClickHouse: https://github.com/ClickHouse/ClickHouse/pull/106650

  • brrrrrm 2 minutes ago

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

  • djsavvy 12 minutes ago

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

  • mixologic 15 minutes ago

    > 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++ ?

      atiedebee 11 minutes ago

      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.

      glouwbug 6 minutes ago

      Guys, remember when language features allowed re-usability?

  • kg 36 minutes ago

    (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

      mcdonje 27 minutes ago

      >(2002)

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

  • glouwbug 39 minutes ago

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

  • tucnak 36 minutes ago

    Who would've guessed? SIMD is so boring.

      Flex247A 28 minutes ago

      time to log off

        trueno 17 minutes ago

        i read that and thought the same. actual based idea its even inspired me to log off

      sigbottle 29 minutes ago

      Honestly part of me feels that way about way too many things in retrospect about my own life and interests.