Re: svn commit: r1865523 - /subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c

2019-08-20 Thread Daniel Shahaf
kot...@apache.org wrote on Tue, 20 Aug 2019 09:23 +00:00:
> +++ subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c Tue Aug 20 
> 09:23:55 2019
> @@ -26,6 +26,7 @@
>  #ifdef SVN_SQLITE_INLINE
>  #  define SQLITE_OMIT_DEPRECATED 1
>  #  define SQLITE_DEFAULT_MEMSTATUS 0
> +#  define SQLITE_OMIT_WAL 1

Quoting https://sqlite.org/compile.html#_options_to_omit_features:

 Important Note: The SQLITE_OMIT_* options may not work with
 the amalgamation. SQLITE_OMIT_* compile-time options usually
 work correctly only when SQLite is built from canonical
 source files.

and a bit later:

 Also, not all SQLITE_OMIT_* options are tested. Some
 SQLITE_OMIT_* options might cause SQLite to malfunction and/or
 provide incorrect answers.

I think we should:

- Revert r1865523
  (feel free to add it to INSTALL, notes/knobs, etc; but off by default, please)

- Stop defining SQLITE_OMIT_DEPRECATED

- Backport the latter change to stable branches.

To the latter two bullet points: I'm aware that
https://sqlite.org/compile.html#recommended_compile_time_options
recommends SQLITE_OMIT_DEPRECATED, but
https://sqlite.org/compile.html#_options_to_omit_features says using
that macro may break correctness (!), and I'm voting to err on the side
of caution.

Thanks for linking the upstream documentation in the log message!

Cheers,

Daniel


>  #  define SQLITE_API static
>  #  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
>  #pragma GCC diagnostic ignored "-Wunreachable-code"
> 
> 
>


svn commit: r1865523 - /subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c

2019-08-20 Thread kotkov
Author: kotkov
Date: Tue Aug 20 09:23:55 2019
New Revision: 1865523

URL: http://svn.apache.org/viewvc?rev=1865523=rev
Log:
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.

* subversion/libsvn_subr/sqlite3wrapper.c
  (): Define SQLITE_OMIT_WAL.

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

Modified: subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c?rev=1865523=1865522=1865523=diff
==
--- subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c Tue Aug 20 
09:23:55 2019
@@ -26,6 +26,7 @@
 #ifdef SVN_SQLITE_INLINE
 #  define SQLITE_OMIT_DEPRECATED 1
 #  define SQLITE_DEFAULT_MEMSTATUS 0
+#  define SQLITE_OMIT_WAL 1
 #  define SQLITE_API static
 #  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
 #pragma GCC diagnostic ignored "-Wunreachable-code"