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

Re: [PATCH] Replace vdelta with xdelta variant

From: Niels Werensteijn <n.werensteijn_at_student.utwente.nl>
Date: Fri, 18 Jan 2008 19:38:32 +0100

Mark Phippard schreef:
> 2008/1/17 Niels Werensteijn <n.werensteijn_at_student.utwente.nl>:
>> This is my first contribution to opensource so please tell me everything
>> I am doing wrong :)
>> I have a big binary installer commited in svn. Exporting this binary
>> costs a lot of time. I traced this down to vdelta. I noticed that it
>> only gets used for chucks which have no source steam. XDelta is supposed
>> to be much faster than vdelta. So I thought: why not adjust the xdelta
>> algorithm to make a diff from itself. I copy/pasted most of the
>> algorithm, adding some minor stuff.
> I am confused by this. I assumed someone who understands this more
> would respond. Since no one has, I'll try. Have you seen these two
> things from past releases?
> http://subversion.tigris.org/svn_1.2_releasenotes.html#xdelta
> http://subversion.tigris.org/svn_1.4_releasenotes.html#svndiff1
> Basically, SVN has already switched from vdelta to xdelta. Now, I
> believe you would have to be on 1.4 and have created your repository
> and dumped/loaded to get all of the benefits. So I did not know if
> your patch was making an incremental improvement for people that have
> not been able to do this, or if you just missed that we switched to
> xdelta altogether.

Yes subversion uses xdelta except in one case. When the source chunk of
the two streams that are "send" is 0. This is the case when the whole
source stream is length 0, or in some cases if the target stream is
(much) larger that the source stream. In this case subversion still uses
vdelta, because xdelta as implemented cannot make a diff without a
source stream. And this is where my solution comes in.

A source stream has length 0 if the file is entirely new. Also
svn_txdelta_send_stream in text_delta.c sends streams as a diff against
an empty stream. I am not sure if there are more situations where
streams are send as a diff against an empty source. (Perhaps export? i
don't know).

I assume that the repository shrink comes from:
1. The first time a file is checked in. This is now compressed with my
version of xdelta, instead of vdelta.
2. When a new version of a file is checked in which is much larger than
the old version.

Niels Werensteijn

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-18 19:38:39 CET

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