subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1139501 - /subversion/trunk/subversion/libsvn_delta/svndiff.c
Date Sat, 25 Jun 2011 08:05:42 GMT
Author: stefan2
Date: Sat Jun 25 08:05:41 2011
New Revision: 1139501

URL: http://svn.apache.org/viewvc?rev=1139501&view=rev
Log:
Optimize data processing in svndiff if we don't want to compress input.

* subversion/libsvn_delta/svndiff.c
  (zlib_encode): bypass pointless zlib call with the "store" method

Modified:
    subversion/trunk/subversion/libsvn_delta/svndiff.c

Modified: subversion/trunk/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/svndiff.c?rev=1139501&r1=1139500&r2=1139501&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/trunk/subversion/libsvn_delta/svndiff.c Sat Jun 25 08:05:41 2011
@@ -144,7 +144,13 @@ zlib_encode(const char *data,
   append_encoded_int(out, len);
   intlen = out->len;
 
-  if (len < MIN_COMPRESS_SIZE)
+  /* Compression initialization overhead is considered to large for
+     short buffers.  Also, if we don't actually want to compress data,
+     ZLIB will produce an output no shorter than the input.  Hence,
+     the DATA would directly appended to OUT, so we can do that directly
+     without calling ZLIB before. */
+  if (   (len < MIN_COMPRESS_SIZE) 
+      || (compression_level == SVN_DELTA_COMPRESSION_LEVEL_NONE))
     {
       svn_stringbuf_appendbytes(out, data, len);
     }



Mime
View raw message