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

[PATCH] delta_files() speedup 3/3: file write buffering

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Sun, 28 Mar 2010 14:50:49 +0200

Hi devs,

this is part of the delta_files() speedup patch series:
http://svn.haxx.se/dev/archive-2010-03/0604.shtml

Under Windows, a significant part of the overall runtime
is spent in writing data to the (already buffered) APR
file implementation. It seems that the mutex serializing
the buffer access in apr_file_write is expensive.

Also, >50% of all write requests are 2 bytes or smaller
(i.e. line endings and empty lines). For them, the deep
call hierarchy constitutes a large overhead on register-
lacking x86.

This patch eliminates far over 90% of all write requests
bringing the portion of time spent in _svn_io_file_write_full
down from about 7 to below 3 percent on 32 bit Windows.

Performance gain is ~1% under Linux but due to the
larger async I/O and mutex overhead it is about 4%
under Windows:

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.697s
user 0m3.148s
sys 0m0.558s

-- Stefan^2.

[[[
Buffer small write requests to APR file streams. For details see
http:// ...

* subversion/libsvn_subr/stream.c
  (baton_apr): add write buffer members
  (flush_buffer_apr): new function
  (read_handler_apr): auto-allocate write buffer and re-direct
   small writes there.
  (read_handler_apr, close_handler_apr, mark_handler_apr,
   seek_handler_apr): flush write buffer before calling i/o functions.

patch by stefanfuhrmann < at > alice-dsl.de
]]]

Received on 2010-03-28 14:51:20 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.