Relative Content

Tag Archive for arrayscperformanceprocessing-efficiency

Performance on array initialization uint8_t vs int vs char in C

I was exploring speed and efficiency across various data types and began experimenting by counting the time of initialization of an array with 100,000 elements, each initialized to 1. I found that the int data type exhibited the fastest performance when allocated on the stack, even though uint_fast8_t provides exactly 8-bits in my 64-bit system (uint_fast16_t and above consistently yielded 64-bit). However, this pattern did not hold when the array was dynamically allocated.