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

[PATCH] Don't waste some APR file buffers

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2007-04-16 22:38:48 CEST

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.

[[[
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
Received on Mon Apr 16 22:39:58 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.