lkml.org 
[lkml]   [1998]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: faster strcpy()
Date
From
Richard B. Johnson wrote:
>
> The string-length is reduced by 64 at each run through the loop.
>
> > You're using a single buffer, which has vastly different L1
> > characteristics than multiple buffers; and different characteristics from
> > what real-world apps would see because they have other things polluting
> > the L1. I bring up this point mostly because the strlen/memcpy version is
> > probably better on the pentium because of the L1 cache design, this is
> > less likely to be an issue on the pentium pro.
> >
> I am using two buffers, one a source and another a destination. They
> are deliberately the same buffers for both tests. There is no way that
> the execution of one string function could affect the other since
> the strings are way too long to fit in a cache.

Huh? Why would a strings of up(*) to 4096 bytes not fit into a cache?
If your cache is exactly the right size, but then has a few more
addresses to cache, a perfect LRU will evict everything just before
it's used. On a set associative cache, just a few words will be
evicted before you get cache hits again!

4k copy and an 8k cache would at the very least mean that it would fit.
Anybody with less than 8k cache raise their hands!

Roger.

(*) (you say you reduce the length every time through the loop)

--
If it's there and you can see it, it's REAL |___R.E.Wolff@BitWizard.nl |
If it's there and you can't see it, it's TRANSPARENT | Tel: +31-15-2137555 |
If it's not there and you can see it, it's VIRTUAL |__FAX:_+31-15-2138217 |
If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983 |_____|

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.055 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site