C is defined in terms of an idealized abstract machine. But real-world hardware has behavioral characteristics that are not taken into account by the language standard. Types _fast are type aliases that allow each platform to define types that are βconvenientβ for hardware.
For example, if you have an array of 8-bit integers and you want to change them individually, it will be quite inefficient for modern desktop computers, since their boot operations usually want to fill the entire processor register, which is either 32 or 64 bits ("machine the word "). Thus, a large amount of downloaded data is wasted, and, more importantly, you cannot parallelize the loading and saving of two adjacent elements of the array, since they live in the same machine word and, therefore, must be sequentially loaded-modified.
_fast types typically have a width as a machine word, if possible. That is, they can be wider than you need, and therefore consume more memory (and therefore harder to cache!), But your hardware can access them faster. However, it all depends on the usage pattern. (For example, an int_fast8_t array is likely to be an array of machine words, and a hard loop modifying such an array can greatly benefit.)
The only way to find out if any value matters is to compare!
source share