Re: [LAD] Integer performance

From: Fons Adriaensen <fons@email-addr-hidden>
Date: Mon May 04 2015 - 00:28:52 EEST

On Sun, May 03, 2015 at 09:02:55PM +0100, Will Godfrey wrote:

> > For arrays of bool, GCC uses a char for each bool.
>
> Ouch! that could get expensive - although I doubt it will ever be an issue for
> me. Certainly worth remembering though.

It's a reasonable compromise. Very few application fields use large
arrays of booleans.

Cryptography is one where logic rather than computation is dominant,
but most algorithms are defined on bytes or words anyway. One trick
used there is to run 32 or 64 copies in parallel by using logical
operations on integers. Provided the parallelism can be exploited,
these are often the fastest versions of crypto algorithms.

Languages such as Matlab and numpy can use large multidimensional
boolean arrays. But they always represent a property of the elements
of a numerical array, so that one will take most of the space.

Ciao,

-- 
FA
A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon May 4 04:15:01 2015

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