Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: hoffman@xdelta.zko.dec.nospam (Hoff Hoffman)
Subject: Re: Optimal use of the L2 cache
Date: Fri, 15 Jun 2001 22:22:15 GMT	[thread overview]
Message-ID: <rUvW6.1512$fi2.45180@news.cpqcorp.net> (raw)
In-Reply-To: 3B2A74B6.5F18718A@physics.odu.edu

In article <3B2A74B6.5F18718A@physics.odu.edu>, Tobias Oed <tobias@physics.odu.edu> writes:

  Operating system, version, and platform?
  Compiler and version?
  Compiler command(s) used?
  Example of the code involved?

:I have a piece of code that does a large amount of 
:floating point computations. In order to get it to 
:run faster, I build a lookup table of ~4000 floating 
:point values...

  You will want the floating point values naturally aligned.

:I access the elements of the table in a more or less random fashion 
:and am affraid that I get a terrible cache performance.

  Yes, you could be thrashing the cache.  Other considerations
  include the floating point format and the data alignment...

:If I am not mistaken, my EV67 has 64k of L2 data cache...

  Which system do you have?

:How could I convince the processor to keep my arrays in that cache.

  I'd normally expect it to happen, unless something else is tossing
  the pages out of cache -- eg: a lack of locality, excessive paging.
  
:Would adding dummy values in the middle of the array help? 

  That would not be my first choice.

:How big should the chunks of used values be and
:how many dummy ones should I insert between them?

  You say you access the data randomly, and your comments imply
  some sort of hashing...

 ---------------------------- #include <rtfaq.h> -----------------------------
      For additional, please see the OpenVMS FAQ -- www.openvms.compaq.com    
 --------------------------- pure personal opinion ---------------------------
   Hoff (Stephen) Hoffman   OpenVMS Engineering   hoffman#xdelta.zko.dec.com



  reply	other threads:[~2001-06-15 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-15 20:48 Optimal use of the L2 cache Tobias Oed
2001-06-15 22:22 ` Hoff Hoffman [this message]
2001-06-15 23:23   ` Tobias Oed
2001-06-16  1:23     ` Hoff Hoffman
2001-06-16 17:42     ` Paul Hughett
2001-06-16 20:50       ` Tobias Oed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox