Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > maximse the use of cache in code

Reply
Thread Tools

maximse the use of cache in code

 
 
zaheer031@gmail.com
Guest
Posts: n/a
 
      01-03-2008
Hi All,

How do I maximse the use of cache( both data and instruction ) in the
code .

I know use of loops and local variables will help but more would be of
good help


Thanks,
Zaheer.
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-03-2008
In article <c588b559-7cc4-40b3-9d20->,
<> wrote:

>How do I maximse the use of cache( both data and instruction ) in the
>code .


comp.arch might be a better newsgroup for you, if you want
information on how various systems work with their caches (i.e.,
with a goal of writing cache-friendly code suitable for multiple
systems.) If you do not care about how cache-friendly your code is
on general systems as long as it maximizes the cache use on a
particular platform, then consult a newsgroup specific for that platform.

The C programming language says little or nothing about caches, and
does itself not provide any of the tools you would need to measure
or improve cache performance. Caching is a matter not within the
pervue of C itself, so this is not an appropriate newsgroup for
advice on cache use.


>I know use of loops and local variables will help but more would be of
>good help


Even that is wrong on some platforms. On some platforms, there is
a small section of memory at the beginning of the address space that
can be addressed with shorter faster instructions (fewer address
bits to work with.) On such systems, the best cache performance
might involve use of that small section of memory rather than involve
use of local variables: when instructions are shorter, more of them
fit into instruction cache. Thus, to maximize your cache use, you
need to use platform-specific information.
--
"Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us." -- Ecclesiastes
 
Reply With Quote
 
 
 
 
Ravishankar S
Guest
Posts: n/a
 
      01-03-2008
<> wrote in message
news:c588b559-7cc4-40b3-9d20-...
> Hi All,
>
> How do I maximse the use of cache( both data and instruction ) in the
> code .
>
> I know use of loops and local variables will help but more would be of
> good help
>

ask in comp.arch


 
Reply With Quote
 
user923005
Guest
Posts: n/a
 
      01-03-2008
On Jan 2, 10:12*pm, "zaheer...@gmail.com" <zaheer...@gmail.com> wrote:
> Hi All,
>
> How do I maximse the use of cache( both data and instruction ) in the
> code .
>
> I know use of loops and local variables will help but more would be of
> good help


http://www.google.com/search?hl=en&q...dly+algorithms
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Cache vs Window System Cache Sergey via DotNetMonster.com ASP .Net 0 11-15-2006 03:33 PM
no-cache - need to reload page from server and not the cache John HTML 2 10-29-2006 05:35 PM
client-side cache vs server-side cache vs ajax vs asp.net callback =?Utf-8?B?b25l?= ASP .Net 1 03-08-2006 12:25 PM
Page.Cache vs HttpContext.Current.Cache DesignerX ASP .Net 5 01-20-2004 10:55 PM
Cache::Cache Stale Segments Jeff Nokes Perl 0 09-30-2003 04:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57