Boost logo

Boost :

From: Anatoliy Kuznetsov (anatoliy_kuznetsov_at_[hidden])
Date: 2002-07-31 10:14:56


>
> As Anatoliy pointed out it's only faster when
> extended to more bits in
> parallel. But I've found that it's faster in the 32
> bit case and up.

Hmm, I need to reevaluate my test. Thanks for pointing
out.

 
> The speedup is mostly due to keeping the computation
> in the ALU, as opposed
> to doing memory access.

I got an impression that in my case all table goes
into the CPU cache which makes memory latency not a
big problem.

> But if you are forced to do it a byte at a time, the
> table would be faster.
 

Also there is a problem of misalignment. If bitset is
character based it is not always safe to adress it as
int*. On non-Intel architectures it can cause a BUS
error.

I got a nice crash on Sparc Solaris when tryed to
access stack allocated array of ints as an array of
64-bit longs. The same trick always worked on SGI.

Anatoliy.
  http://bmagic.sourceforge.net

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk