[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 svn_repos_authz_check_access

From: Roderich Schupp <roderich.schupp_at_gmail.com>
Date: Wed, 7 Aug 2013 19:19:53 +0200

On Wed, Aug 7, 2013 at 3:59 PM, Ivan Zhakov <ivan_at_visualsvn.com> wrote:

> Could you please provide log message for your patch submission [1]. It
> makes reviewing patch much easier.
>

See below.

> Did you consider make separate cache_pool and clear if we invoked with
> different user?
>

I revised the patch so that svn_authz_t->pool is now a sub pool of the pool
passed
to authz_create() and will be cleared when we encounter a different user.

[[[
Speed up svn_repos_authz_check_access() by caching the results of previous
lookups.

This patch reduces the cumulative time spent in
svn_repos_authz_check_access ()
(when called repeteadly on the same connection) by more than 50%.

* subversion/libsvn_repos/authz.c
  (svn_authz_t) Add members CACHE, CACHED_USER, POOL
   to hold cached results.
  (authz_lookup_baton) Replace member svn_config_t * CONFIG
   with svn_authz_t * AUTHZ.
  (authz_create) New function, allocates and initializes a svn_authz_t.
  (svn_repos__authz_read, svn_repos_authz_parse) Use authz_create()
   to create a svn_authz_t.
  (authz_get_path_access, authz_get_tree_access, authz_get_any_access)
   Expect svn_authz_t * parameter instead of svn_config_t *.
  (authz_lookup_cached) New function. This is a wrapper for
        svn_config_enumerate2(..., path, authz_parse_line, baton, ...)
   that first consults the cache for the result of a previous call for the
same path.
  (authz_parse_section, authz_get_path_access,
   authz_get_any_access_parser_cb) Replace calls of svn_config_enumerate2()
   by authz_lookup_cached().
  (svn_repos_authz_check_access) Purge the cache if USER is different
   from authz->cached_user. Pass svn_authz_t * instead of svn_config_t *
   to authz_get_*_access() functions.
]]]

Cheers, Roderich

Received on 2013-08-07 19:20:32 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.