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

Re: [PATCH] Elminate duplicate MD5 calculation in FSFS

From: Stefan Fuhrman <stefanfuhrmann_at_alice-dsl.de>
Date: Tue, 06 Apr 2010 21:59:50 +0200

Greg Stein wrote:
> When I wrote svn_txdelta_run() a while back, I seem to recall that it
> could be used in the FS library, if a couple function calls get
> collapsed. i.e part of the process is started in one function, then
> completed in another function. But overall, those two pieces do what
> svn_txdelta_run() does. And... txdelta_run allows for skipping the
> checksum thing.
>
> Is this code amenable to using svn_txdelta_run? That would simplify
> things, and we wouldn't need another entry point.
>
Hm, not sure (getting a full understanding of the SVN code base is
hard for neophytes like me). What my patch does, is making
svn_fs_get_file_delta_stream return an "unchecked" stream, i.e.
patching the get_file_delta_stream method in the FSFS file system
vtable.

I only updated svn_txdelta_send_stream because it was the only
piece of code I found that potentially tried to access the checksum
(which would not be available).

If there is a more elegant solution, I'm all for it. But I don't have
the knowledge to do that.

-- Stefan^2.
> On Tue, Apr 6, 2010 at 14:24, Stefan Fuhrmann
> <stefanfuhrmann_at_alice-dsl.de> wrote:
>
>> Hi devs,
>>
>> FSFS calculates and checks MD5 in rep_read_contents.
>> So, there is no reason so calculate it a second time in the
>> delta stream svn_fs_fs__get_file_delta_stream returns.
>> However, it gets calculated there "accidentally" and not
>> used later.
>>
>> This patch adds a variant of svn_txdelta() that will not
>> calculate the checksum. It uses that new function in FSFS.
Received on 2010-04-06 22:00:33 CEST

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.