When compiling SQLite, enable the SQLITE_OMIT_WAL compile-time option.
We don't use WAL (write-ahead logging) feature of SQLite, but just keeping it enabled has a visible I/O performance penalty, because SQLite has to check if the write-ahead log file is present on disk. In a couple of my experiments, disabling this feature resulted in a ~10% faster `svn st` on a large working copy.
When compiling SQLite, set the SQLITE_DEFAULT_MEMSTATUS=0 compile-time option.
This is the recommended option that is not enabled by default. Setting it to zero avoids using a mutex (and thus suffering a performance penalty) during every sqlite3_malloc() call, where this mutex is used to properly update the allocations stats. We don't use sqlite3_status(), so set this option to zero.