Re: [OT]state space logic execution speed

From: Richard Gooch (rgooch@ras.ucalgary.ca)
Date: Thu Mar 30 2000 - 11:43:53 EST


Karen Shaeffer writes:
> Hi Folks,
>
> I am developing a state space logic machine. In considering the
> implementation, I have two choices.
>
> 1.) I can utilize an array of integers, manipulating the space with
> operations on these integers.
>
> 2.) I can utilize bit-fields, manipulating the space with operations on
> these bit-fields.
>
> Can anyone please advise me about the tradeoffs inherent to these
> two options concerning speed of execution WRT decision logic and the
> implication for porting to other target platforms. I'm looking for
> maximum execution speed. The target platform is initially X86. I
> have some ideas about this, but would be interested in other
> opinions as well.

It depends on how big your array of integers would be. If it fits
inside the L1 cache (or even the L2 cache), then you're probably
better off saving them as integers, since you can avoid the
computational overheads of bit-fiddling. If the array of integers is
>> L2 cache, and the access pattern is random, then you are better off
using a bit array, so you reduce the number of cache misses.

Why not make your array accesses macros, and then implement each
option and compare the times?

                                Regards,

                                        Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:27 EST