You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/02/12 23:42:35 UTC

svn commit: r1659426 - /subversion/trunk/subversion/libsvn_subr/sqlite.c

Author: ivan
Date: Thu Feb 12 22:42:35 2015
New Revision: 1659426

URL: http://svn.apache.org/r1659426
Log:
Use journal_mode = TRUNCATE for sqlite [1] instead of default DELETE value. 
It makes svn checkout about 10% faster on Windows at expense of one empty 
file in .svn. Create/delete file is relatively expensive operation on 
Windows, especially if indexes/virus scanners are enabled.

The TRUNCATE and DELETE journal modes are compatible, so different
Subversion clients with different journal mode should just work with same 
working copy without problems.

[1] http://www.sqlite.org/pragma.html#pragma_journal_mode

* subversion/libsvn_subr/sqlite.c
  (svn_sqlite__open): Execute PRAGMA journal_mode = TRUNCATE when opening 
   sqlite database.

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

Modified: subversion/trunk/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sqlite.c?rev=1659426&r1=1659425&r2=1659426&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite.c Thu Feb 12 22:42:35 2015
@@ -1171,7 +1171,8 @@ svn_sqlite__open(svn_sqlite__db_t **db,
                  affects application(read: Subversion) performance/behavior. */
               "PRAGMA foreign_keys=OFF;"      /* SQLITE_DEFAULT_FOREIGN_KEYS*/
               "PRAGMA locking_mode = NORMAL;" /* SQLITE_DEFAULT_LOCKING_MODE */
-                            ),
+              "PRAGMA journal_mode = TRUNCATE;"
+              ),
                 *db);
 
 #if defined(SVN_DEBUG)



Re: svn commit: r1659426 - /subversion/trunk/subversion/libsvn_subr/sqlite.c

Posted by Branko Čibej <br...@wandisco.com>.
On 12.02.2015 23:42, ivan@apache.org wrote:
> Author: ivan
> Date: Thu Feb 12 22:42:35 2015
> New Revision: 1659426
>
> URL: http://svn.apache.org/r1659426
> Log:
> Use journal_mode = TRUNCATE for sqlite [1] instead of default DELETE value. 
> It makes svn checkout about 10% faster on Windows at expense of one empty 
> file in .svn. Create/delete file is relatively expensive operation on 
> Windows, especially if indexes/virus scanners are enabled.
>
> The TRUNCATE and DELETE journal modes are compatible, so different
> Subversion clients with different journal mode should just work with same 
> working copy without problems.


Good catch. Should be faster on many other platforms, too.

-- Brane