reducing memmoves

Wayne Davison wayned at
Mon Aug 2 07:06:26 GMT 2004

One comment on eliminating the read-behind in map_ptr():

The sender's read pattern can jump back a blocksize or so when it is
scanning the file using the rolling checksum and it needs to send out
the just-passed data that it didn't find a match for.  We don't want
this data to be re-read from disk, so we should make sure that this
unmatched data is retained in the buffer.

I think a good way to do this (when combined with the removal of the
window_start-kluge in map_ptr() that your patch removed) would be to
have the sender code call map_ptr() with a read range that includes the
start of the unmatched data that it needs up through the rolling-
checksum area that it is processing.  This way it would always tell
map_ptr() what memory must be preserved to prevent a re-read.


More information about the rsync mailing list