Re: [LAD] Integer performance

From: Will J Godfrey <WillGodfrey@email-addr-hidden>
Date: Sun May 03 2015 - 23:04:30 EEST

On Sun, 03 May 2015 21:36:25 +0200
Florian Weimer <fw@email-addr-hidden> 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.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon May 4 00:15:01 2015

This archive was generated by hypermail 2.1.8 : Mon May 04 2015 - 00:15:01 EEST