/[Apache-SVN]
ViewVC logotype

Revision 1704317


Jump to revision: Previous Next
Author: kotkov
Date: Mon Sep 21 15:19:40 2015 UTC (9 years, 1 month ago)
Changed paths: 4
Log Message:
[ Note from the future:
  The "HTTPv2 == svndiff1" detection was reverted in r1791290.
  And see r1704891 that adds a proper server-side capability for svndiff1. ]

Use compressed svndiff1 format for deltas when committing changes over
http:// and https://.

Something I learned while working on the ra_serf-stream-commit branch is
that ra_serf doesn't use compression when sending deltas over http(s)://
— as opposed to, for instance, ra_svn, where compression is turned on by
default.  Enabling compression has a positive impact on commits that happen
over the WAN, especially, with slow connections, where the network speed is
the bottleneck.

Benchmarks over http:// with the repository located on a remote server,
before and after this patch:

1) Committing a Windows application build (.exe, .dll, resources),
   35 files, 55 MiB total size:

   51.901 s → 22.404 s

2) Committing a random bunch of compressible and incompressible files,
   135 files, 161 MiB total size:

   156.072 s → 115.445 s

3) Importing a subtree of TortoiseSVN's trunk, 1742 files, 81 MiB total size:

   186.548 s → 167.285 s

4) Importing Windows Installer log files, 23 files, 15 MiB total size:

   15.130 s → 6.030 s

So, we begin using compressed svndiff1 format in ra_serf, if that's possible.
This is done for servers that advertise Subversion's HTTP v2 protocol, unless
compression is disabled by the 'http-compression = no' client configuration
option.  Existing Apache HTTPd + mod_dav_svn servers know how to deal with
svndiff1, starting from Subversion 1.4, but the reasoning behind enabling
it with HTTP v2 is that if the user is stuck with the old protocol version,
she probably does not really care about the performance.  I tested existing
custom implementations of Subversion's HTTP v2 protocol that are not based
on mod_dav_svn, and they as well now how to deal with svndiff1 format.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__session_t.using_compression): Update comment.
  (svn_ra_serf__session_t.supports_svndiff1): New field.

* subversion/libsvn_ra_serf/options.c
  (capabilities_headers_iterator_callback): Remember that we can use svndiff1
   upon witnessing a Subversion's HTTPv2 protocol header.  Document the
   reasoning behind this.

* subversion/libsvn_ra_serf/commit.c
  (apply_textdelta): Use svndiff1 when calling svn_txdelta_to_svndiff3(), if
   possible.

* subversion/libsvn_ra_serf/serf.c
  (ra_serf_dup_session): Duplicating a session begins with apr_pmemdup(), and
   automatically covers all primitive fields, e.g., the new supports_svndiff1
   field or already existing supports_rev_rsrc_replay field.  So, just update
   the comment block.


Changed paths

Path Details
Directorysubversion/trunk/subversion/libsvn_ra_serf/commit.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_ra_serf/options.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_ra_serf/ra_serf.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_ra_serf/serf.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26