pq-code-package / mlkem-native

High-assurance, high-performance ML-KEM implementation for mobile, pc, and server targets
https://pq-code-package.github.io/mlkem-native/dev/bench/
Apache License 2.0
11 stars 9 forks source link

Bump GCC version in nix to gcc-14 #238

Open hanno-becker opened 1 month ago

hanno-becker commented 1 month ago

We're currently using gcc-13, but as @mkannwischer noticed in #224, there is a meaningful performance impact from moving to gcc-14. Moreover, there even appears to be differences even between gcc-14 in nix, and gcc-14 in arch.

hanno-becker commented 1 month ago

@mkannwischer Please add some colour here based on your experiments.

mkannwischer commented 1 month ago

Hmm, it's not as easy as I thought, I'm afraid.

I was running gcc 14.2.1 from https://archlinux.org/packages/core/x86_64/gcc/ for natively compiling code on my x86 and got much better performance of the AVX2 implementation than when using gcc-13 (gcc 13.2.0) (38540 vs. 42050).

I then tried to instead install gcc14 from nix. There is gcc 14.1.0 in the stable 24.05 channel and gcc 14.2.0 in the unstable channel. Unfortunately, with both versions I get basically get the same performance as with gcc 13.2.0 from nix.

So I suspect this is not due to the gcc version at all, but rather the defaults that they are compiled with.