3 ms·
> which is supposed to be faster. If you care about this, you figure out exactly how much you need and always use the smallest type that meets this criteria.
by Tuna-Fish 2y ago
> which is supposed to be faster.
If you care about this, you figure out exactly how much you need and always use the smallest type that meets this criteria.
There have been architectures in the past where the "native" size was in practice faster than the smaller types, but those architectures are now long dead. On all modern architectures, none of the instructions for smaller data types are ever slower than the native size, and while using them doesn't directly win you cycles of execution time in the cpu (because they are no faster either), it wins you better cache utilization. As a rule, the fastest data type is a byte.
There is no reason to ever use "int", other than inertia.
- jraph 2y agoI was under the impression that native into size was still faster on current architectures, I guess I have stuff to read! Thanks for telling me. > There is no reason to ever use "int", other than inertia. ...and DX, as I said.