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

Re: [PATCH] Don't waste some APR file buffers

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-04-17 00:15:03 CEST

On Mon, 16 Apr 2007, Eric Gillespie wrote:

> In the "Is mod_dav_svn safe for use in a threaded MPM?" thread,
> Malcolm Rowe <malcolm-svn-dev@farside.org.uk> writes:
>
> > Opening the file in buffered mode when you're going to read
> > everything at once just wastes a 4k APR file buffer.
>
> So i looked at the other APR_BUFFERED uses in fsfs, and found
> some that were similarly wasteful.

+1, this patch does what's intended. We're sure there's no unexpected
side-effects from this?

> [[[
> Don't waste a APR file buffer when reading some trivial files.
>
> * subversion/libsvn_fs_fs/fs_fs.c
> (svn_fs_fs__open): Drop APR_BUFFERED when opening UUID file.
> (read_current): Drop APR_BUFFERED option when opening current file.
> (read_next_ids): Drop APR_BUFFERED option when opening next-ids file.
> ]]]
>
> Index: fs_fs.c
> ===================================================================
> --- fs_fs.c (revision 24576)
> +++ fs_fs.c (working copy)
> @@ -848,7 +848,7 @@
>
> /* Read in and cache the repository uuid. */
> SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, pool),
> - APR_READ | APR_BUFFERED,
> APR_OS_DEFAULT, pool));
> + APR_READ, APR_OS_DEFAULT, pool));
>
> limit = sizeof(buf);
> SVN_ERR(svn_io_read_length_line(uuid_file, buf, &limit,
> pool));
> @@ -941,7 +941,7 @@
> svn_pool_clear(iterpool);
>
> SVN_RETRY_ESTALE(err, svn_io_file_open(&revision_file,
> fname,
> - APR_READ |
> APR_BUFFERED,
> + APR_READ,
> APR_OS_DEFAULT,
> iterpool));
>
> len = CURRENT_BUF_LEN;
> @@ -3414,7 +3414,7 @@
> char *str, *last_str;
>
> SVN_ERR(svn_io_file_open(&file, path_txn_next_ids(fs, txn_id,
> pool),
> - APR_READ | APR_BUFFERED,
> APR_OS_DEFAULT, pool));
> + APR_READ, APR_OS_DEFAULT, pool));
>
> limit = sizeof(buf);
> SVN_ERR(svn_io_read_length_line(file, buf, &limit, pool));
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

  • application/pgp-signature attachment: stored
Received on Tue Apr 17 00:16:40 2007

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.