I changed some Golang code to AVX in my last project. In isolation that code ran like 2-4x faster but as part of the full program, the program was 5% slower overall. Could never make a sense of it. Any thoughts on how to determine the cause?
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
where instead of cpu0 you can write any core number, and it will give you the current frequency of that core in KHz.
When you run it in isolation, there's more headroom since only one core can run at the higher freq. and use AVX512 registers.
Also the power license ensures the cores running AVX512 code runs at a lower frequency.
Make sure to guard your AVX512 code block with VZEROUPPER when exiting it