[LAD] Integer performance

Will Godfrey willgodfrey at musically.me.uk
Sat May 2 19:57:25 UTC 2015


On Sat, 02 May 2015 21:06:40 +0200
Clemens Ladisch <clemens at ladisch.de> wrote:

> Will Godfrey wrote:
> > 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?
> 
> That depends on the CPU architecture.

I thought someone might say that :p

> Which is why <stdint.h> defines types like int16_fast_t.
> 
> > Also, would bool actually have an extra cost due to masking needs?
> 
> What masking?

Presumably bits have to be masked when being set or read to provide the boolean
action. I wouldn't expect true single bit direct storage to be available.

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


More information about the Linux-audio-dev mailing list