You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2015/06/04 15:34:14 UTC

Re: svn commit: r1683544 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

I would say it is safer to cache SVN_INVALID_REVNUM (or another certainly invalid revision number) than to set the potentially valid r0.


Bert






Sent from Surface





From: Ivan Zhakov
Sent: ‎Thursday‎, ‎June‎ ‎4‎, ‎2015 ‎3‎:‎25‎ ‎PM
To: commits@subversion.apache.org





Author: ivan
Date: Thu Jun  4 13:25:21 2015
New Revision: 1683544

URL: http://svn.apache.org/r1683544
Log:
Minor FSFS optimization: do not read 'current' file on FS open to save
cached youngest revision. Current API users often call 
svn_fs_youngest() right after svn_fs_open() which cause 'current' file 
read again.

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__open): Do not call get_youngest(). Just initialize
   ffd->youngest_rev_cache to zero.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1683544&r1=1683543&r2=1683544&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Thu Jun  4 13:25:21 2015
@@ -1126,7 +1126,9 @@ svn_fs_fs__open(svn_fs_t *fs, const char
   /* Global configuration options. */
   SVN_ERR(read_global_config(fs));
 
-  return get_youngest(&(ffd->youngest_rev_cache), fs, pool);
+  ffd->youngest_rev_cache = 0;
+
+  return SVN_NO_ERROR;
 }
 
 /* Wrapper around svn_io_file_create which ignores EEXIST. */

Re: svn commit: r1683544 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 4 June 2015 at 16:34, Bert Huijben <be...@qqmail.nl> wrote:
> I would say it is safer to cache SVN_INVALID_REVNUM (or another certainly
> invalid revision number) than to set the potentially valid r0.
>
Hi Bert,

Any repository has zero revision, so it's pretty safe to assume that
repository youngest revision at least 1 revision. But I may to improve
code if you think that current approach is not safe enough.

-- 
Ivan Zhakov

Re: svn commit: r1683544 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 4 June 2015 at 16:34, Bert Huijben <be...@qqmail.nl> wrote:
> I would say it is safer to cache SVN_INVALID_REVNUM (or another certainly
> invalid revision number) than to set the potentially valid r0.
>
Hi Bert,

Any repository has zero revision, so it's pretty safe to assume that
repository youngest revision at least 1 revision. But I may to improve
code if you think that current approach is not safe enough.

-- 
Ivan Zhakov