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

Re: [PATCH] Reduce disk access when browsing non-versioned directories

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-02-27 19:59:21 CET

Tobias Schäfer wrote:
> Hi
>
> using filemon from sysinternals I noticed that while browsing non-versioned
> directories there are always two disk accesses which both return "file not
> found". These are accesses to .svn\entries and .svn\dir-props.
>
> Do we really need to check if .svn\dir-props exists if .svn\entries is not
> present? Assuming we don't, I propose the following patch. Please review
> because I'm not too familar with the cache.
>
> May I commit?

Not yet :) See my comment below.

> Index: src/TSVNCache/CachedDirectory.cpp
> ===================================================================
> --- src/TSVNCache/CachedDirectory.cpp (revision 8782)
> +++ src/TSVNCache/CachedDirectory.cpp (working copy)
> @@ -200,7 +200,7 @@
> entriesFilePath.AppendPathString(g_SVNAdminDir.GetAdminDirName() + _T("\\entries"));
> propsDirPath.AppendPathString(g_SVNAdminDir.GetAdminDirName() + _T("\\dir-props"));
> }
> - if (m_entriesFileTime == entriesFilePath.GetLastWriteTime() && m_propsFileTime == propsDirPath.GetLastWriteTime())
> + if (m_entriesFileTime == entriesFilePath.GetLastWriteTime())

We really need to check both, but of course if entriesFilePath does not
exist, *then* we can avoid checking the filetime of propsDirPath.

So, I suggest this:

if (m_entriesFileTime == entriesFilePath.GetLastWriteTime() &&
entriesFilePath.Exists() && ...)

Note that .Exists() doesn't touch the harddrive because
GetLastWriteTime() already did that.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Feb 27 19:59:33 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.