You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/18 13:28:33 UTC

svn commit: r1533396 - /subversion/trunk/subversion/libsvn_fs_fs/tree.c

Author: stefan2
Date: Fri Oct 18 11:28:33 2013
New Revision: 1533396

URL: http://svn.apache.org/r1533396
Log:
Minor tuning of our all-time favorite hot path: get_dag.

* subversion/libsvn_fs_fs/tree.c
  (get_dag): unconditionally canonicalize the path - see comment

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

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1533396&r1=1533395&r2=1533396&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Fri Oct 18 11:28:33 2013
@@ -1241,15 +1241,14 @@ get_dag(dag_node_t **dag_node_p,
 
   if (! node)
     {
-      /* Canonicalize the input PATH. */
-      if (! svn_fs__is_canonical_abspath(path))
-        {
-          path = svn_fs__canonicalize_abspath(path, pool);
-
-          /* Try again with the corrected path. */
-          SVN_ERR(dag_node_cache_get(&node, root, path, needs_lock_cache,
-                                     pool));
-        }
+      /* Canonicalize the input PATH.  As it turns out, >95% of all paths
+       * seen here during e.g. svnadmin verify are non-canonical, i.e.
+       * miss the leading '/'.  Unconditional canonicalization has a net
+       * performance benefit over previously checking path for being
+       * canonical. */
+      path = svn_fs__canonicalize_abspath(path, pool);
+      SVN_ERR(dag_node_cache_get(&node, root, path, needs_lock_cache,
+                                 pool));
 
       if (! node)
         {