[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Eliminating multiple file-reads of text-base on updated targets

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-12-06 10:05:35 CET

I've found an optimization which would fit nicely in the 1.4
'libsvn_wc optimizing release': libsvn_wc calls svn_io_file_checksum
on files it just read or wrote - meaning it reads them again to
calculate the checksum.

My plan involves:

- creating an svn_stream_checksummed, like svn_subst_stream_translated.
- let the stream raise an error on close if the stream checksum
doesn't match a given checksum value (with an error message text
passed to it on creation)
- create svn_stream_checksummed_get_sum() to retrieve the checksum
from the checksummed stream
- add the checksumming stream to the source stream in
adm_crawler.c:svn_wc_transmit_text_deltas()

The last step optimizes the common case which is supposed to pass the
checksum test. In the uncommon case of not passing the checksum test,
we read too much off the network, but the common case reads the text
base twice.

The svn_stream_checksummed_get_sum() can be used later to do something
similar with streams that are being written, for which we need the
checksum later on.

Comments?

bye,

Erik.
Received on Tue Dec 6 10:06:21 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.