subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1544717 - /subversion/trunk/subversion/libsvn_fs_fs/low_level.c
Date Sat, 23 Nov 2013 00:14:08 GMT
Author: stefan2
Date: Sat Nov 23 00:14:07 2013
New Revision: 1544717

URL: http://svn.apache.org/r1544717
Log:
Parsing revnode structures is the single most expensive (CPU-wise)
operation when reading data from FSFS.  Reduce the overhead.

* subversion/libsvn_fs_fs/low_level.c
  (read_header_block): use our fast hash plus the fact that we
                       already know the key sizes

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

Modified: subversion/trunk/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/low_level.c?rev=1544717&r1=1544716&r2=1544717&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/low_level.c Sat Nov 23 00:14:07 2013
@@ -25,6 +25,7 @@
 #include "svn_pools.h"
 #include "svn_sorts.h"
 #include "private/svn_string_private.h"
+#include "private/svn_subr_private.h"
 
 #include "../libsvn_fs/fs-loader.h"
 
@@ -482,13 +483,14 @@ read_header_block(apr_hash_t **headers,
                   svn_stream_t *stream,
                   apr_pool_t *pool)
 {
-  *headers = apr_hash_make(pool);
+  *headers = svn_hash__make(pool);
 
   while (1)
     {
       svn_stringbuf_t *header_str;
       const char *name, *value;
-      apr_size_t i = 0;
+      apr_ssize_t i = 0;
+      apr_ssize_t name_len;
       svn_boolean_t eof;
 
       SVN_ERR(svn_stream_readline(stream, &header_str, "\n", &eof, pool));
@@ -509,6 +511,7 @@ read_header_block(apr_hash_t **headers,
       /* Create a 'name' string and point to it. */
       header_str->data[i] = '\0';
       name = header_str->data;
+      name_len = i;
 
       /* Skip over the NULL byte and the space following it. */
       i += 2;
@@ -528,7 +531,7 @@ read_header_block(apr_hash_t **headers,
 
       /* header_str is safely in our pool, so we can use bits of it as
          key and value. */
-      svn_hash_sets(*headers, name, value);
+      apr_hash_set(*headers, name, name_len, value);
     }
 
   return SVN_NO_ERROR;



Mime
View raw message