Posted by Roger Holmes on February 10, 2004 at 13:05:09:
On Tuesday, February 10, 2004, at 07:11 pm, Chris Dillman wrote:
> Would a look up table be faster in some cases or a less accurate sqrt
> call?
> Or is the more accurate called really needed in Quesa?
>With the current architecture of the Mac at least, using a look up
table is actually
slower as the processor has to load four words from main RAM into the
processor
cache, and each of the four accesses take so long compared with the
speed of
the processor that is actually quicker to work out the value. I know
this sounds
weird as it took a lot of testing before I relegated one of my
favourite algorithms
- the large look up table - to the pages of history. For small tables,
after a few
uses the entire table gets into the cache, but large tables are now a
no no.
Somehow turning off the cache before accessing RAM might help but that
is
something which sounds dangerous, maybe even more so in dual processor
Macs.Roger Holmes.