I’m working on an embedded project, and in searching for some help in manipulating 24-bit audio data, came across this SO page with this answer:
Working with anything smaller than an integer (32 or 64 bit depending on your architecture) is not ideal. All CPU operations of the smaller data types (short, etc) are done using integer arithmetic. Conversion to and from the CPU has to be done, slowing your application down (even if it is just a tad).
Is this true for most compilers? I’m compiling for esp32, and I had figured I should use small datatypes when I can to save memory; i.e., using a
uint8_t when iterating 0 to 10. The esp32 has quite a lot of memory for embedded (for my uses), so would it actually be faster to just use
int, even for small numbers? Or is there a way I can find out?