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

Re: [PATCH] Speed up client by re-using RA session connections

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Thu, 15 Sep 2011 16:23:05 +0400

On Thu, Sep 15, 2011 at 16:05, Julian Foad <julian.foad_at_wandisco.com> wrote:
> Thanks for the feedback, everyone.  Looks like the principle of re-using
> connections is sound but this implementation is way wrong :-)
>
> I'm not working much on this right now and will come back to it later,
> but here's a dump of my current brain state.
>
>
[...]

>
>
Hi Julian,

Thanks for great discussion summary.

I still think that we need to implement explicit call function, to use
it in functions like svn_client__get_repos_root():
[[[
  svn_ra_session_t *ra_session;

  /* If PATH_OR_URL is a local path we can fetch the repos root locally. */
  if (!svn_path_is_url(abspath_or_url))
    {
      SVN_ERR(svn_wc__node_get_repos_info(repos_root, NULL,
                                          ctx->wc_ctx, abspath_or_url,
                                          result_pool, scratch_pool));

      return SVN_NO_ERROR;
    }

  /* If PATH_OR_URL was a URL, we use the RA layer to look it up. */
  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL,
                                               abspath_or_url,
                                               NULL, NULL, FALSE, TRUE,
                                               ctx, scratch_pool));

  SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
]]]

And callers use pattern like this:
[[[
  /* Determine the working copy target's repository root URL. */
  SVN_ERR(svn_client__get_repos_root(&wc_repos_root, target_abspath,
                                     ctx, scratch_pool, scratch_pool));

  /* Determine the source's repository root URL. */
  SVN_ERR(svn_client__get_repos_root(&source_repos_root, url2,
                                     ctx, scratch_pool, scratch_pool));
]]

Creating subpools for each call to such function is not inconvenient,
but I agree that we can add explicit close any time.

-- 
Ivan Zhakov
Received on 2011-09-15 14:24:00 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.