[Zlib-devel] Proposed code change

Mark Brown broonie at sirena.org.uk
Sat Oct 28 10:25:23 EDT 2006


On Sat, Oct 28, 2006 at 10:04:02AM -0400, Steve Snyder wrote:

> The improvement comes from copying the data in multiple bytes rather 
> than one byte at a time.  The original code is a looped "*out++ = 
> *in++" meaning 2 memory access and 2 pointer increments for each byte 
> copied.  The patch attempts to copy the data in 32-bit blocks, falling 
> back to the original code if the 32-bit copy is not practical.  

Have you benchmarked using memcpy() instead?  Compilers are often able
to optimise that and will tend to have an easier job taking advantage of
whatever platform specific tricks are available.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20061028/0e4c0cbd/attachment.sig>


More information about the Zlib-devel mailing list