
21 Jan
2025
21 Jan
'25
5:06 p.m.
Ivan Matek wrote:
There is also the fact that fastest type may not be fastest for all compute benchmarks you can imagine, I presume on modern CPUs this does not matter, but maybe for some old CPU for add one type is fastest, for mul other is...
On modern compilers, the knowledge the compiler derives from knowing that the value fits in 16 bits (when uint16_t is used) is generally much more valuable (because it allows the backend to pick the right instructions) than when uint_fast16_t = uint64_t is used. Basically, _fast types are almost never fast. Let's hope this curse doesn't afflict Decimal _fast types as well. :-)