You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2011/02/15 13:14:49 UTC
svn commit: r1070861 - in /subversion/trunk/subversion/libsvn_ra_serf:
property.c ra_serf.h serf.c
Author: ivan
Date: Tue Feb 15 12:14:48 2011
New Revision: 1070861
URL: http://svn.apache.org/viewvc?rev=1070861&view=rev
Log:
ra_serf: Remove caching of DAV properties in ra_session object. Main
reasons are:
1) Current implementation is broken (unbound memory usage, caching of
dynamic properties)
2) Very low hit rate.
Discussion:
http://thread.gmane.org/gmane.comp.version-control.subversion.devel/125833
* subversion/libsvn_ra_serf/property.c
(svn_ra_serf__propfind_context_t): Remove unused member.
(end_propfind): Do not cache properties in session object.
(check_cache): Remove.
(svn_ra_serf__deliver_props): Remove checking for cached properties.
* subversion/libsvn_ra_serf/ra_serf.h
(svn_ra_serf__session_t): Removed unused cached_props hash.
* subversion/libsvn_ra_serf/serf.c
(svn_ra_serf__open): Remove initialization of cached_props hash.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/property.c
subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
subversion/trunk/subversion/libsvn_ra_serf/serf.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=1070861&r1=1070860&r2=1070861&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Tue Feb 15 12:14:48 2011
@@ -87,9 +87,6 @@ struct svn_ra_serf__propfind_context_t {
/* the list of requested properties */
const svn_ra_serf__dav_props_t *find_props;
- /* should we cache the values of this propfind in our session? */
- svn_boolean_t cache_props;
-
/* hash table that will be updated with the properties
*
* This can be shared between multiple svn_ra_serf__propfind_context_t
@@ -385,18 +382,6 @@ end_propfind(svn_ra_serf__xml_parser_t *
ctx->current_path, ctx->rev,
ns, pname, val_str,
ctx->pool);
- if (ctx->cache_props)
- {
- ns = apr_pstrdup(ctx->sess->pool, info->ns);
- pname = apr_pstrdup(ctx->sess->pool, info->name);
- val = apr_pmemdup(ctx->sess->pool, info->val, info->val_len);
- val_str = svn_string_ncreate(val, info->val_len, ctx->sess->pool);
-
- svn_ra_serf__set_ver_prop(ctx->sess->cached_props,
- ctx->current_path, ctx->rev,
- ns, pname, val_str,
- ctx->sess->pool);
- }
svn_ra_serf__xml_pop_state(parser);
}
@@ -533,40 +518,6 @@ create_propfind_body(serf_bucket_t **bkt
return SVN_NO_ERROR;
}
-static svn_boolean_t
-check_cache(apr_hash_t *ret_props,
- svn_ra_serf__session_t *sess,
- const char *path,
- svn_revnum_t rev,
- const svn_ra_serf__dav_props_t *find_props,
- apr_pool_t *pool)
-{
- svn_boolean_t cache_hit = TRUE;
- const svn_ra_serf__dav_props_t *prop;
-
- /* check to see if we have any of this information cached */
- prop = find_props;
- while (prop && prop->namespace)
- {
- const svn_string_t *val;
-
- val = svn_ra_serf__get_ver_prop_string(sess->cached_props, path, rev,
- prop->namespace, prop->name);
- if (val)
- {
- svn_ra_serf__set_ver_prop(ret_props, path, rev,
- prop->namespace, prop->name, val, pool);
- }
- else
- {
- cache_hit = FALSE;
- }
- prop++;
- }
-
- return cache_hit;
-}
-
/*
* This function will deliver a PROP_CTX PROPFIND request in the SESS
* serf context for the properties listed in LOOKUP_PROPS at URL for
@@ -597,25 +548,10 @@ svn_ra_serf__deliver_props(svn_ra_serf__
svn_ra_serf__handler_t *handler;
svn_ra_serf__xml_parser_t *parser_ctx;
- if (cache_props)
- {
- svn_boolean_t cache_satisfy;
-
- cache_satisfy = check_cache(ret_props, sess, path, rev, find_props,
- pool);
-
- if (cache_satisfy)
- {
- *prop_ctx = NULL;
- return SVN_NO_ERROR;
- }
- }
-
new_prop_ctx = apr_pcalloc(pool, sizeof(*new_prop_ctx));
new_prop_ctx->pool = apr_hash_pool_get(ret_props);
new_prop_ctx->path = path;
- new_prop_ctx->cache_props = cache_props;
new_prop_ctx->find_props = find_props;
new_prop_ctx->ret_props = ret_props;
new_prop_ctx->depth = depth;
Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1070861&r1=1070860&r2=1070861&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Tue Feb 15 12:14:48 2011
@@ -132,9 +132,6 @@ struct svn_ra_serf__session_t {
/* Our Version-Controlled-Configuration; may be NULL until we know it. */
const char *vcc_url;
- /* Cached properties */
- apr_hash_t *cached_props;
-
/* Authentication related properties. */
svn_auth_iterstate_t *auth_state;
int auth_attempts;
Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1070861&r1=1070860&r2=1070861&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Tue Feb 15 12:14:48 2011
@@ -354,7 +354,6 @@ svn_ra_serf__open(svn_ra_session_t *sess
serf_sess->pool = svn_pool_create(pool);
serf_sess->bkt_alloc = serf_bucket_allocator_create(serf_sess->pool, NULL,
NULL);
- serf_sess->cached_props = apr_hash_make(serf_sess->pool);
serf_sess->wc_callbacks = callbacks;
serf_sess->wc_callback_baton = callback_baton;
serf_sess->wc_progress_baton = callbacks->progress_baton;