[LAD] Integer performance

Florian Weimer fw at deneb.enyo.de
Sun May 3 19:36:25 UTC 2015


* Will Godfrey:

> Just a curious thought...
>
> If you are using only small values is there really any benefit in
> using chars and shorts rather than just using integers everywhere
> and letting the compiler sort it out?

Many languages do not actually support arithmetic on chars and shorts,
but promote them to ints first.

It is usually beneficial to use the smallest possible data type for
arrays because it cuts down memory use and increases the number of
array elements which fit into the CPU caches.


More information about the Linux-audio-dev mailing list