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

Re: [wc-propcaching]: Cache existence of certain properties

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-11-10 22:05:21 CET

On Thu, 2005-11-10 at 21:44 +0100, Peter N. Lundblad wrote:
> On Thu, 10 Nov 2005, Daniel Berlin wrote:
>
> > This patch adds the ability to cache whether certain properties exist in
> > the entries file. It does not cache their values.
> >
> There are stylistic stuff, but I see this as a prototype.
>
>
> > Index: subversion/include/svn_wc.h
> > ===================================================================
> > --- subversion/include/svn_wc.h (revision 17287)
> > +++ subversion/include/svn_wc.h (working copy)
> > @@ -1216,6 +1216,10 @@ typedef struct svn_wc_entry_t
> > * @since New in 1.4. */
> > svn_boolean_t prop_mods;
> >
> > + /** Cached property existence for this entry.
> > + * @since New in 1.4. */
> > + const char *has_properties;
> > +
>
> The problem with using a string for this is space. An apr_uint32_t
> with bits for signle props would be more space-efficient than a little
> string for each entry. NOt that we are terribly space-efficient for
> the entry cache, but that's another topic.

Actually, i'm not sure this makes sense, thinking harder about it.

Everywhere else treats props as strings, and compares prop names against
strings. I don't really think it's worth the 10 bytes per prop name you
are going to save to

1. Establish a parallel mapping between property names and ints,
including a lookup table.
2. Lookup the name everywhere just to get the int.
3. Then store it back in the entries file as a string.

Seems like an awful lot of work just to save ~15 bytes per entry.

Even if you had 40,000 entries all kept in cache at once, you are
talking, this isn't even a megabyte of saved memory.

--Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 10 22:06:11 2005

This is an archived mail posted to the Subversion Dev mailing list.