[PLUG] Cache usage and integer computation speed

Rogan Creswick creswick at gmail.com
Tue Nov 22 23:00:19 UTC 2005


Disclaimer: I'm not really qualified to answer this, so everyone pipe
up if I'm wrong :) Basically, I'm looking to start a discussion here.

On 11/22/05, Keith Lofstrom <keithl at kl-ic.com> wrote:
> So the question:  what percentage of cache size should I target
> my application and table to run in?  That is, how big can a chunk
> of code and data get before performance starts to degrade?

I doubt you'll be able to avoid cache misses*, but you can avoid
swapping by just counting your free memory at runtime and subtracting
your program's dynamic needs (including storage for output data.)

FWIW, your table could at least be a multiple of getpagesize() bytes
(4096 on my system).

* Eventually isn't it likely that even local (stack) variables will
end up in cache, and cause portions of your table to be relegated bace
to standard memory? Presumeably you won't be accessing every value in
the table more than anything else.. or will you?

--Rogan

>
> Keith
>
> --
> Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
> KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
> Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list