[libcxx-commits] [libcxx] optimize minmax_element (PR #135495)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 23 02:06:42 PDT 2025


wsehjk wrote:

> seems like you are getting speedup on large sizes (>64 etc). Maybe use the default algorithm for small sizes and switch to new implementations otherwise?

No, the speedups for `char`, `short`, `int` and `long loog` are about 10x, 6x, 3x and 0.91x respectively. The vector size for each integer is not fixed, but determined by platform. Plz check [simd_utils.h](https://github.com/llvm/llvm-project/blob/main/libcxx/include/__algorithm/simd_utils.h#L75). I'm tesing on MaxOs, which only supports sse. For x86 platform, the speedup could be better. But I haven't get time to test it.


https://github.com/llvm/llvm-project/pull/135495


More information about the libcxx-commits mailing list