[LAD] Integer performance
Will J Godfrey
WillGodfrey at musically.me.uk
Sun May 3 20:04:30 UTC 2015
On Sun, 03 May 2015 21:36:25 +0200
Florian Weimer <fw at deneb.enyo.de> wrote:
> * 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.
Currently I work in C and C++. I don't see that changing any time soon. They are
more then enough to keep me occupied!
> 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.
Good point. I didn't think of that.
--
It wasn't me! (Well actually, it probably was)
... the hard part is not dodging what life throws at you,
but trying to catch the good bits.
More information about the Linux-audio-dev
mailing list