subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1082451 - /subversion/trunk/subversion/libsvn_subr/io.c
Date Thu, 17 Mar 2011 12:21:29 GMT
Author: rhuijben
Date: Thu Mar 17 12:21:29 2011
New Revision: 1082451

URL: http://svn.apache.org/viewvc?rev=1082451&view=rev
Log:
On Windows avoid a file flush that is taking over 15% of the checkout time.

* subversion/libsvn_subr/io.c
  (svn_io_write_unique): Avoid a very costly file flush on Windows.

Modified:
    subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1082451&r1=1082450&r2=1082451&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Thu Mar 17 12:21:29 2011
@@ -3199,8 +3199,17 @@ svn_io_write_unique(const char **tmp_pat
 
   err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool);
 
-  if (!err)
+  /* ### BH: Windows doesn't have the race condition between the write and the
+     ###     rename that other operating systems might have. So allow windows
+     ###     to decide when it wants to perform the disk synchronization using
+     ###     the normal file locking and journaling filesystem rules.
+
+     ### Note that this function doesn't handle the rename, so we aren't even
+     ### sure that we really have to sync. */
+#ifndef WIN32
+  if (!err && nbytes > 0)
     err = svn_io_file_flush_to_disk(new_file, pool);
+#endif
 
   return svn_error_return(
                   svn_error_compose_create(err,



Mime
View raw message