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

Re: [PATCH] delta_files() speedup 2/3: keyword substitution

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 29 Mar 2010 16:22:54 +0100

On Sun, 2010-03-28, Stefan Fuhrmann wrote:
> Hi devs,
>
> this is part of the delta_files() speedup patch series:
> http://svn.haxx.se/dev/archive-2010-03/0604.shtml
>
> translate_chunk spends most of its time in a loop
> looking for the next '$' or newline. The call to strchr
> is excessively expensive since the 'interesting' string
> is no longer than 3 chars.
>
> It is much more efficient to use a simple lookup table
> (boolean array) that tells us whether a certain char
> is 'interesting' or not. Since we call it for almost every
> char in the file, the initialization overhead amortizes
> within the first two lines of the respective file.
>
> Performance gain is ~9%:
>
> s~$ time ~/1.7-928181/svn export --ignore-externals -q $REPO/trunk /dev/shm/t
> real 0m3.727s
> user 0m3.189s
> sys 0m0.542s
>
> ~$ time ~/1.7-patched/svn export --ignore-externals -q $REPO/trunk /dev/shm/t
> real 0m3.410s
> user 0m2.872s
> sys 0m0.537s
>
> -- Stefan^2.
>
> [[[
> Optimize the search for 'interesting' characters that
> control the keyword substitution. For details see
> http:// ...
>
> * subversion/libsvn_subr/subst.c
> (translation_baton): the 'interesting' member is now
> a boolean array.
> (create_translation_baton): adapt initialization code
> (translate_chunk): eliminate call to strchr
>
> patch by stefanfuhrmann < at > alice-dsl.de
> ]]]

This patch looks lovely, from the point of view of a read-through
review.

- Julian
Received on 2010-03-29 17:23:29 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.