subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1506960 - in /subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs: cached_data.c transaction.c
Date Thu, 25 Jul 2013 13:27:33 GMT
Author: stefan2
Date: Thu Jul 25 13:27:33 2013
New Revision: 1506960

URL: http://svn.apache.org/r1506960
Log:
On the fsfs-improvements:  A few function-local optimizations.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__get_node_revision): access ID only once

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__txn_changes_fetch): allocate file in scratch pool and
                                  let it close up automatilcally
  (choose_delta_base): extract a common sub-expressiom

Modified:
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c?rev=1506960&r1=1506959&r2=1506960&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c Thu Jul 25
13:27:33 2013
@@ -319,6 +319,8 @@ svn_fs_fs__get_node_revision(node_revisi
                              const svn_fs_id_t *id,
                              apr_pool_t *pool)
 {
+  const svn_fs_fs__id_part_t *rev_offset = svn_fs_fs__id_rev_offset(id);
+
   svn_error_t *err = get_node_revision_body(noderev_p, fs, id, pool);
   if (err && err->apr_err == SVN_ERR_FS_CORRUPT)
     {
@@ -329,8 +331,8 @@ svn_fs_fs__get_node_revision(node_revisi
     }
 
   SVN_ERR(dbg_log_access(fs,
-                         svn_fs_fs__id_rev(id),
-                         svn_fs_fs__id_offset(id),
+                         rev_offset->revision,
+                         rev_offset->number,
                          *noderev_p,
                          SVN_FS_FS__ITEM_TYPE_NODEREV,
                          pool));

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c?rev=1506960&r1=1506959&r2=1506960&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c Thu Jul 25
13:27:33 2013
@@ -828,8 +828,10 @@ svn_fs_fs__txn_changes_fetch(apr_hash_t 
   apr_array_header_t *changes;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
-  SVN_ERR(svn_io_file_open(&file, path_txn_changes(fs, txn_id, pool),
-                           APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool));
+  SVN_ERR(svn_io_file_open(&file,
+                           path_txn_changes(fs, txn_id, scratch_pool),
+                           APR_READ | APR_BUFFERED, APR_OS_DEFAULT,
+                           scratch_pool));
 
   SVN_ERR(svn_fs_fs__read_changes(&changes,
                                   svn_stream_from_aprfile2(file, TRUE,
@@ -838,8 +840,6 @@ svn_fs_fs__txn_changes_fetch(apr_hash_t 
   SVN_ERR(process_changes(changed_paths, changes, pool));
   svn_pool_destroy(scratch_pool);
 
-  SVN_ERR(svn_io_file_close(file, pool));
-
   *changed_paths_p = changed_paths;
 
   return SVN_NO_ERROR;
@@ -1654,6 +1654,7 @@ choose_delta_base(representation_t **rep
   base = noderev;
   while ((count++) < noderev->predecessor_count)
     {
+      svn_revnum_t base_revision;
       SVN_ERR(svn_fs_fs__get_node_revision(&base, fs,
                                            base->predecessor_id, pool));
 
@@ -1666,16 +1667,15 @@ choose_delta_base(representation_t **rep
        *
        * Message-ID: <CA+t0gk1wzitkih3GRCLDvK-bTEm=hgppGb_7xXMtvuXDYPfL+Q@mail.gmail.com>
        */
+      base_revision = svn_fs_fs__id_rev(base->id);
       if (props)
         {
-          if (   base->prop_rep
-              && svn_fs_fs__id_rev(base->id) > base->prop_rep->revision)
+          if (base->prop_rep && base_revision > base->prop_rep->revision)
             maybe_shared_rep = TRUE;
         }
       else
         {
-          if (   base->data_rep
-              && svn_fs_fs__id_rev(base->id) > base->data_rep->revision)
+          if (base->data_rep && base_revision > base->data_rep->revision)
             maybe_shared_rep = TRUE;
         }
     }



Mime
View raw message