|
From: Julian S. <js...@ac...> - 2005-07-19 07:45:11
|
> >> (2) if memcpy zeroes out the target before copying. This has been shown > >> to improve the performance of memcpy on some intel architectures, due to > >> cache effects. Of course it is fatal if there is any overlap between > >> source and target. Most memcpy's don't do this kind of trick, but it's > >> worth keeping in mind. > > > > I think it's common on the PPC, because the dcbz instruction zeros a > > cache line in preparation for the destination write (this is based on 5 > > year old PPC experience, so I don't know what's best on a modern > > implementation). Yeh, it allocates the line in L2 without having to fetch it from memory since we know it's just about to be completely overwritten. Certainly memset in glibc uses dcbz; not sure about memcpy. J |