473,467 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

maximse the use of cache in code

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.
Jan 3 '08 #1
3 1852
In article <c5**********************************@e10g2000prf. googlegroups.com>,
za*******@gmail.com <za*******@gmail.comwrote:
>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
Jan 3 '08 #2
<za*******@gmail.comwrote in message
news:c5**********************************@e10g2000 prf.googlegroups.com...
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
Jan 3 '08 #3
On Jan 2, 10:12*pm, "zaheer...@gmail.com" <zaheer...@gmail.comwrote:
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
Jan 3 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: emerth | last post by:
Hello all: I have read references to optimizing C code to exploit the CPU cache of <insert your favourite CPU>. Can anyone point me towards some info on the 'net that gets into techniques for...
5
by: sklett | last post by:
Hi- I am having a hard time decided where I should be implementing my Cache code. I store most of the DataSet's that I need in the Cache. I was doing it in the bind method of my pages, but...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
2
by: moondaddy | last post by:
I had to repost this because I had to update and change my msdn alias. I will re-ask the question and clarify a few things that were not clear before. This code is all executed on my dev...
5
by: J055 | last post by:
Hi The following code works on my develeopment machine using the VS web server. When I run the application on 2 other Windows 2003/IIS 6 servers no caching seems to take place at all. Can...
0
by: Hypnotik | last post by:
My program is to simulate cache memory. I read in the info from 2 external files, 1) access 2) data in memory. When I read the information in I display the info...and it is all correct. However...
2
by: =?Utf-8?B?Y2F0?= | last post by:
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0 and Windows 2003 Server SP2. We started experiencing the following issue with the web cache (the code is straightforward...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.