Hi,
Currently Subversion client layer creates new RA session for every
svn_client_* call. Even more: for some operations like
svn_client_merge() it creates 10-15 RA sessions. Each session creation
takes significant amount of time: TCP connection, SSL handshake,
authentication and initial handshake. It easily could take several
seconds over WAN.
To solve this problem I propose to introduce RA context abstraction
layer for managing set of RA sessions for different repositories and
reuse them if possible. In the first version I made this layer
libsvn_client private, but in we can make it part of ra-loader in
future.
The patch is attached. It passes all tests of course. I'm very
interested for feedback. Proposed solution should make our svn merge
code much easy to maintain and significantly faster.
[[[
Introduce repository access abstraction layer for managing RA session for
different repositories.
* subversion/include/private/svn_client_private.h
(svn_client__ra_session_release): New.
(svn_client__ra_session_from_path2): Document that created session will be
automatically returned back to RA session cache on pool cleanup.
* subversion/libsvn_client/ra.c
(): Include ra_ctx.h.
(svn_client__open_ra_session_internal): Use svn_client__ra_session_open().
(svn_client__ra_session_release): New. Wrapper around
svn_client__ra_ctx_release_session()
* subversion/include/svn_client.h
(svn_client_ctx_t): Add RA_CTX member.
* subversion/libsvn_client/ctx.c
(): Include ra_ctx.h.
(svn_client_create_context2): Initialize RA_CTX.
* subversion/libsvn_client/log.c
(svn_client_log5): Return RA session back to session cache.
* subversion/libsvn_client/ra_ctx.c
* subversion/libsvn_client/ra_ctx.h
(svn_client__ra_ctx_t, svn_client__ra_ctx_create,
svn_client__ra_session_open, svn_client__ra_ctx_release_session): New.
]]]
--
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Received on 2013-06-11 15:23:01 CEST