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

Re: export, checkout, commit performance

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-10 01:38:28 CET

Branko Čibej wrote:
>
> How about this one, as a stopgap:
>
> Index: subversion/libsvn_subr/io.c
> ===================================================================
> --- subversion/libsvn_subr/io.c (revision 18760)
> +++ subversion/libsvn_subr/io.c (working copy)
> @@ -988,7 +988,7 @@
> struct apr_md5_ctx_t context;
> apr_file_t *f = NULL;
> svn_error_t *err;
> - char buf[BUFSIZ]; /* What's a good size for a read chunk? */
> + char *buf = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
> apr_size_t len;
>
> /* ### The apr_md5 functions return apr_status_t, but they only
> @@ -999,12 +999,12 @@
>
> SVN_ERR(svn_io_file_open(&f, file, APR_READ, APR_OS_DEFAULT, pool));
>
> - len = sizeof(buf);
> + len = SVN__STREAM_CHUNK_SIZE;
> err = svn_io_file_read(f, buf, &len, pool);
> while (! err)
> {
> apr_md5_update(&context, buf, len);
> - len = sizeof(buf);
> + len = SVN__STREAM_CHUNK_SIZE;
> err = svn_io_file_read(f, buf, &len, pool);
> };

+1, except don't just change this function but also all the other places we use
it: that's two other functions in io.c, and also:
subversion/libsvn_wc/entries.c:read_entries(),
subversion/libsvn_wc/log.c:run_log(),
subversion/svnlook/main.c:do_cat().

At a quick look, it seems right to change all of these to use a pool-allocated
buffer of SVN__STREAM_CHUNK_SIZE bytes.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 10 01:38:52 2006

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