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

Re: svn commit: rev 885 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-15 01:09:32 CET

On Mon, Jan 14, 2002 at 05:05:56PM -0600, sussman@tigris.org wrote:
>...
> * props.c (svn_wc__save_prop_file): pass APR_TRUNCATE whenever we
> write out a property file. I can't believe we weren't doing this.

The format of the property files makes it acceptable not truncate. We read
to the "END" marker, rather than EOF. Thus, if you write a prop file shorter
than before, you ignore stuff at the end. If you write longer, then the EOF
== the "END" string.

Truncate is best, but the file format is what has saved us.

>...
> +++ NEW/trunk/subversion/libsvn_wc/get_editor.c Mon Jan 14 17:05:56 2002
>...
> +latest_keyword_data (apr_array_header_t *props,
> + svn_io_keywords_t *keywords,
> + apr_pool_t *pool)
> +{
> + int i;
> +
> + if (! (props && keywords))
> + return;
> +
> + /* foreach prop... */
> + for (i = 0; i < props->nelts; i++)
> + {
> + svn_stringbuf_t *propname;
> + svn_prop_t *prop;
> + prop = (((svn_prop_t **)(props)->elts)[i]);
> +
> + /* strip the 'svn:entry:' prefix from the property name. */
> + propname = svn_stringbuf_dup (prop->name, pool);
> + svn_wc__strip_entry_prefix (propname);

You'll get better memory performance if you do:

    propname = svn_stringbuf_create("", pool);
    
    for (...)
        ...
        svn_stringbuf_set(propname, prop->name);
        svn_wc__strip_entry_prefix(...)
        ...

You get to reuse the propname buffer over and over.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 2006

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.