Cpp uint32_fast_t resolves to uint64_t but is slower for nearly all operations than a uint32_t (x86_64). Why does it resolve to uint64_t?
问题 Ran a benchmark and uint32_fast_t is 8 byte but slower than 4 byte uint32_t for nearly all operations. If this is the case why does uint32_fast_t not stay as 4 bytes? OS info: 5.3.0-62-generic #56~18.04.1-Ubuntu SMP Wed Jun 24 16:17:03 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Cpu info: cat /sys/devices/cpu/caps/pmu_name skylake model name : Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz Benchmark I used for testing: #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <cstdint>