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

[wc-propcaching]: Cache existence of certain properties

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-11-10 18:33:06 CET

This patch adds the ability to cache whether certain properties exist in
the entries file. It does not cache their values.

This massively speeds up operations like update and commit, which need
to know about certain properties on each file or directory.

The implementation simply stores an extra attribute in the entries file,
which is a string containing the names of the properties that are
cached, and exist for a file/directory.

It was decided to use a single string for simplicity, and because using
multiple attributes doesn't actually buy you anything (in any case,
adding or removing to the list of cached properties will require format

The string has no particular ordering properties, and is space

The list of cached properties is also stored as a single string, comma
separated. A new function, svn_wc_cached_properties, will return this
list of cached properties. It is kept as a string again for simplicity.
Only the things updating the props file want to be able to split it into
an array, and do so. The getter functions simply want to know if the
property they are asking about is in the list, and we can just use
strstr for that.

This code passes all regression tests.

However, the upgrading code for it is not written yet. Thus, it will
only work properly on clean checkouts. It looks like an upgrade will
require loading and saving all the props files so the appropriate
properties get cached in the entries.

Add caching of property existence for a few select properties.

* subversion/include/svn_wc.h
  (struct svn_wc_entry_t): Add has_properties member.
  (svn_wc_cached_properties): New prototype.

* subversion/libsvn_wc/props.c
  (svn_wc__install_props): Set has_properties from the
  from the props we are going to install.
  (svn_wc_prop_get): Short circuit the cached properties
  by checking if they exist before reading the props file.
  (svn_wc_cached_properties): New function.

* subversion/libsvn_wc/entries.c
  (svn_wc__atts_to_entry): Add code to handle has_properties.
  (write_entry): Ditto.
  (fold_entry): Ditto.
  (svn_wc_entry_dup): Ditto.

* subversion/libsvn_wc/entries.h

* subversion/libsvn_wc/log.c
  (svn_wc__loggy_entry_modify): Add code to handle has_properties.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Nov 10 18:35:20 2005

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.