By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Optimized memcpy to reduce cache misses

P: n/a
I'm trying to come up with a more cache efficient memcpy loop
to reduce the number of cache misses I'm experiencing.

My current solution:

for (i = 1; i < numlines; i++)
{
foo(Offset >= 0);
RMemCopy(CurrentPos, Line, (unsigned)Abs(Offset));
CurrentPos += Offset;
}

I'm even open to inline ASM.

Any ideas?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sun, 03 Aug 2003 12:12:05 GMT, "John Edwards" <sa***@caselearning.com>
wrote:
I'm trying to come up with a more cache efficient memcpy loop
to reduce the number of cache misses I'm experiencing.

My current solution:

for (i = 1; i < numlines; i++)
{
foo(Offset >= 0);
RMemCopy(CurrentPos, Line, (unsigned)Abs(Offset));
CurrentPos += Offset;
}

I'm even open to inline ASM.

Any ideas?


This is not a C++-related question, but a microprocessor-specific one.

Having said that, I have written memcpy and memset routines that are
specifically targeted to take advantage of a particular microprocessor's
instruction and data cache architecture.

How I did it is beyond the scope of this newsgroup.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.