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

Re: 'svn blame' speedup in 1.2

From: Sander Striker <striker_at_apache.org>
Date: 2005-03-29 02:34:28 CEST

Ben Collins-Sussman wrote:
> After chatting with Daniel Berlin in IRC, let me explain what's going
> on with 'svn blame' in 1.2, for those who haven't been following.
>
> The goal is to bring what is essentially a 5x speedup to absolutely
> everyone. In order to achieve that speedup, Daniel's plan looks like
> this:
>
> A. use xdelta instead of vdelta in the repository.
>
> B. expand svn_ra_get_revisions() to optionally return fulltexts in
> youngest->oldest order, rather than our current oldest->youngest
> order.
>
> C. teach the client a new algorithm to process the incoming
> youngest->oldest fulltexts.
>
> Part (A) is finished and committed. Even by itself, this change makes
> reconstruction of older files much faster. (Admins will need to
> dump/reload to see this benefit, of course.)
>
> Part (B) is done, and is the patch Daniel just posted. It implements
> the server-side code for delivering fulltexts in the new order, as
> well as all three RA implementations of the new request. It could be
> committed anytime.
>
> Part (C) is the current blocker. The new annotation algorithm needs
> to read commands to explicitly add and delete lines... it's what 'diff
> -n' shows. libsvn_diff has no such API -- it merely says "change this
> set of lines to this new set."

The API is set up for what you want.

You want to run svn_diff_output() with a svn_diff_output_fns_t vtable
which only defines output_diff_modified; something like:

svn_error_t *lines_added_and_removed(void *output_baton,
                                     apr_off_t original_start,
                                     apr_off_t original_length,
                                     apr_off_t modified_start,
                                     apr_off_t modified_length,
                                     apr_off_t latest_start,
                                     apr_off_t latest_length)
{
  blame_baton_t *blame_baton = output_baton;

  /* Lines removed range from original_start to
   * original_start + original_lenght.
   */
  
  /* Lines added range from modified_start to
   * modified_start + modified_length.
   */

  return SVN_NO_ERROR;
}

> So as a temporary shim, Daniel's patch
> is calling out to GNU diff... which really isn't acceptable.
>
> What would be great is if someone could add the new API to libsvn_diff
> (sander?), so we can finish and commit (C).

Do we really need a new API? It will only be a simple convenience
function.

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 29 02:35:44 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.