Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Sep 2, 2022

https://www.sqlite.org/compile.html

SQLITE_DQS

This setting disables the double-quoted string literal misfeature.

SQLITE_DEFAULT_MEMSTATUS

This setting causes the sqlite3_status() interfaces that track
memory usage to be disabled.
This helps the sqlite3_malloc() routines run much faster, and since
SQLite uses sqlite3_malloc() internally, this helps to make the
entire library faster.

SQLITE_OMIT_DEPRECATED

Omitting deprecated interfaces and features will not help SQLite
to run any faster.
It will reduce the library footprint, however. And it is the
right thing to do.

SQLITE_OMIT_SHARED_CACHE

Omitting the possibility of using shared cache allows many
conditionals in performance-critical sections of the code to be
eliminated. This can give a noticeable improvement in performance.

Also: https://www.sqlite.org/sharedcache.html

Shared-cache mode is an obsolete feature.
The use of shared-cache mode is discouraged.
Most use cases for shared-cache are better served by WAL mode.
Applications that build their own copy of SQLite from source code
are encouraged to use the -DSQLITE_OMIT_SHARED_CACHE compile-time
option, as the resulting binary will be both smaller and faster.

SQLITE_OMIT_JSON

Starting with sqlite 3.38.0 the JSON extension became opt-out rather
than opt-in, so we disable it here.

--disable-rtree

An R-Tree is a special index that is designed for doing range queries.
R-Trees are most commonly used in geospatial systems...
https://www.sqlite.org/rtree.html

--disable-fts4 --disable-fts5

FTS5 is an SQLite virtual table module that provides full-text
search functionality to database applications.

DSQLITE_LIKE_DOESNT_MATCH_BLOBS

simplifies the implementation of the LIKE optimization and allows
queries that use the LIKE optimization to run faster.

DSQLITE_OMIT_DECLTYPE

By omitting the (seldom-needed) ability to return the declared type of
columns from the result set of query, prepared statements can be made
to consume less memory.

DSQLITE_OMIT_PROGRESS_CALLBACK

By omitting this interface, a single conditional is removed from the
inner loop of the bytecode engine, helping SQL statements to run slightly
faster.

DSQLITE_OMIT_AUTOINIT

with the SQLITE_OMIT_AUTOINIT option, the automatic initialization is omitted.
This helps many API calls to run a little faster
it also means that the application must call sqlite3_initialize()
manually.

On my Linux box this results in a libsqlite3.a that shrinks from ~1.7mb to ~1.3mb.
On macOS, libsqlite3.a shrinks from ~2.2mb to ~1.3mb.

Guix Build:

04626ec7b64086103bfb5537397d7953d0699b31da1b1bc100003c7d30991fdf  guix-build-dee690257c79/output/aarch64-linux-gnu/SHA256SUMS.part
a77c72052266788e890a0d3d89cc6eee9dd72db6a1b6fdc8aab882b35a315284  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu-debug.tar.gz
86d782f185ee0fae8e8733ab8a511de2ca2500f02eb3d4aaa20d65b4434dcd77  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu.tar.gz
d81874ecd378470b01a429f2a4be07fcb4824b56ace146226b77088cc3c41baa  guix-build-dee690257c79/output/arm-linux-gnueabihf/SHA256SUMS.part
8f24076800e5a19ac9005af8c6e4987b32e0a857a83af84931958505228ef58d  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf-debug.tar.gz
b913f2b0d8f0e32a176bc0e9330106cf1973afe6e8ee955f3eeb89918ab9d565  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf.tar.gz
034b47d8a60a19391e0e18f6fcc8fb3a87be78a9707e3ac3e7ee45eb37687bb7  guix-build-dee690257c79/output/arm64-apple-darwin/SHA256SUMS.part
9efc5c0ceac05f6efce03fcde0cbe8b79bae43fe0d98aecb817908e76f5c39b7  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.dmg
a549cdcbd311d9b025971b13987290f6cd2b93e16c8389e8a7a2ccd3608326ed  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.tar.gz
3dd9e26a41596151022aa4288d778dc335a2b38bd391e3f65c0575dd6eb47b54  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin.tar.gz
a71685a3ff62fbf456fc1d3c0f78ab7ab1d5a4a094c1f43d3829730d65a3ec51  guix-build-dee690257c79/output/dist-archive/bitcoin-dee690257c79.tar.gz
d5c74167b2260b7de72fdbac77eedacbbb929214e279e07f41c3236ea20116b6  guix-build-dee690257c79/output/powerpc64-linux-gnu/SHA256SUMS.part
03c043daa971f70886805c9e4174acd600e5cda03ae0e827043c4df81a6a6426  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu-debug.tar.gz
3884423f67d48f671a90169962f9568dcbd8df582cd269df29a4399dc9c70e99  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu.tar.gz
cee2847d4feeadebfdf4d37110faafa250824c68cfefc3bfa289ae8b09599a20  guix-build-dee690257c79/output/powerpc64le-linux-gnu/SHA256SUMS.part
ca9f1085184b50e7bd377b68a58afd42ac4055ffe214eede8c6ca7291e00b45a  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu-debug.tar.gz
b9cadff5b30244f6cb4f277e1ac610841332cb0d732637fe438fd51c88adf5a4  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu.tar.gz
db6e45d9fc8868e5cb25fa3d0789247db10a6bab2a6f3866a27d641ae00bd03b  guix-build-dee690257c79/output/riscv64-linux-gnu/SHA256SUMS.part
751e90c0aefa249f175c0c1707dc5eee3637e2b9657a9ee1b2068479e9830ff0  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu-debug.tar.gz
8dd87bb24f1fbdba67fb6b72ab5fc93532452eada8c2942463100b8ed8118ae3  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu.tar.gz
b53fe650f431e394a5af6bd809401551e3c36e4f7d90c31f39f51c5fe236efaf  guix-build-dee690257c79/output/x86_64-apple-darwin/SHA256SUMS.part
b35b4ae345a625e42b8315acd9b75bb651f60265f67ec6f7d78a41c8d21c635e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.dmg
6748e4c64ae069632624cbec20de7f03eca1a7578fcef96607f3e8cb0ac4106e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.tar.gz
6415cbecfa18002a1e4865b996268558b4f26121118fd73b0ef4ca44967f34c7  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin.tar.gz
f0a8d8837e80e42b5d77c3efc9d746c11ffc9909aece16dcba0a10726e1be7e0  guix-build-dee690257c79/output/x86_64-linux-gnu/SHA256SUMS.part
418f4607159387ee17657120beda1c741fa6060e4457b304b857aa6c33859e6a  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu-debug.tar.gz
d384fe8f2d6515c256a371ad84ae76ac9727ffd49887c0e22bb5ada4cd890092  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu.tar.gz
3f441eb2d68ddd530b32f56a16ff639b27dcc58b5ba395e40f4c2be805f6cd8b  guix-build-dee690257c79/output/x86_64-w64-mingw32/SHA256SUMS.part
d3d22479adc554ced965c4bde79f4c919e6b216acfca598fac4ebfc3b0e2d39d  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-debug.zip
89de153f5d839df6cd1266f8b3cb3ad455b2f6c43cee7644889da1e3efc7b2f1  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-setup-unsigned.exe
ba30708b9551b3794e4d2726aff27775dd4f1b347ea71b3fe1b00e39e8b7a594  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-unsigned.tar.gz
ab6a2b7a3e899fc58030a44b555e449d64aa69b5215d761bc550946b14f93515  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64.zip

@luke-jr
Copy link
Member

luke-jr commented Sep 4, 2022

Concept ACK

@Sjors
Copy link
Member

Sjors commented Sep 5, 2022

tACK 8427128

I ran the timing test from #25985 on the machine where brew's sqlite was slow:

  1. Depends sqlite (3.38.5) before this PR: 3.9s
  2. Depends sqlite with this PR: 3.9s

So no performance difference, but disabling stuff we don't need is useful.

@hebasto
Copy link
Member

hebasto commented Sep 6, 2022

Concept ACK.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 23, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto, Sjors, achow101
Concept ACK luke-jr

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

@fanquake fanquake force-pushed the sqlite3_reccomended_compile_opts branch from 8427128 to 602b109 Compare December 5, 2022 11:38
@fanquake fanquake marked this pull request as ready for review December 5, 2022 11:38
@fanquake
Copy link
Member Author

fanquake commented Dec 5, 2022

Rebased, and marked as reviewable.

@jarolrod
Copy link
Member

jarolrod commented Dec 5, 2022

GUIX hashes

x86:

1e3ac267ba615a4754b592252945e40a7f2796879e72116ea1f9199d9913b309  guix-build-602b109e1b1e/output/aarch64-linux-gnu/SHA256SUMS.part
355e5f6404b371d917becf2eb58cf615de709f19f2865731a60cf31269c70162  guix-build-602b109e1b1e/output/aarch64-linux-gnu/bitcoin-602b109e1b1e-aarch64-linux-gnu-debug.tar.gz
dd848b375a1f457085b531b5e8bb968e622a87b0b99a9491f77f70f22c4695f2  guix-build-602b109e1b1e/output/aarch64-linux-gnu/bitcoin-602b109e1b1e-aarch64-linux-gnu.tar.gz
646ad55b330ed30c67335e220271d0940e7d4e2d5d8b9e937668e40c9a5d0796  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/SHA256SUMS.part
9f43027fb3fcfdd5210d235a5456002cefabefb1830a4eeab27e1fd64d4b6ea9  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/bitcoin-602b109e1b1e-arm-linux-gnueabihf-debug.tar.gz
2bbd035970596c3c571ad2c16320f3533b2c9211b42e4e84f4fee8a7bf1fa466  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/bitcoin-602b109e1b1e-arm-linux-gnueabihf.tar.gz
3b9cda7d87ceb0f80ffe5ed97bb327284ad9b9768cac9b62957fab90e4e2962e  guix-build-602b109e1b1e/output/arm64-apple-darwin/SHA256SUMS.part
989acc0300e9ea069d2db13c1a5204548cd8f94991fa9373c7a3dd9ce8e5a2a9  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin-unsigned.dmg
b9f9830c4676aa9e8e29d51194d3d323f4c47858bc6ba996b47974f6a14e0a3e  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin-unsigned.tar.gz
caea2d3b41cf1ae2d74e87fdb9a2f0f493a8ef4d22eac6f5eea8d921e41a5a79  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin.tar.gz
ab590dfd207a1df6130b3b07db39eda1cac1bbf87911cadea1b252a9aaa80ebf  guix-build-602b109e1b1e/output/dist-archive/bitcoin-602b109e1b1e.tar.gz
b3f09e0939c29e46b77aec0d0512d17fb176c55071eaae47ff17757c02a544d9  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/SHA256SUMS.part
dd1715d4b32b23cb88d5628f8122422e0585e791733d9c938f9bb721e0f292fb  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/bitcoin-602b109e1b1e-powerpc64-linux-gnu-debug.tar.gz
cdad479cfec300acf36c02f8b499d987b47ea4782e1ac48f5a8606e6cc5537ff  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/bitcoin-602b109e1b1e-powerpc64-linux-gnu.tar.gz
eb7342cf9859e4d88a4677f02b5f358d368cc355d9009089fadfaa154793058b  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/SHA256SUMS.part
882c23e8fade3f46a8c26068da311271f217421aa61822aa80d5a48f56c9f129  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/bitcoin-602b109e1b1e-powerpc64le-linux-gnu-debug.tar.gz
c17028bfca6edd63cb4661f7363f8c3d7b4f57dd57d095675e447d8cc7e7b390  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/bitcoin-602b109e1b1e-powerpc64le-linux-gnu.tar.gz
97456d1b72826559cfb99336dc14a6b55cc2871a845979d64c6f130f8b6034b6  guix-build-602b109e1b1e/output/riscv64-linux-gnu/SHA256SUMS.part
534f36917d3512b0d36603189d013bd12aa77271c73368f40bd5be62c8961cbc  guix-build-602b109e1b1e/output/riscv64-linux-gnu/bitcoin-602b109e1b1e-riscv64-linux-gnu-debug.tar.gz
2732d11d0197e61531f0c2b8ba2ce5d2f8eadf3794f99c411376a3fcea54936f  guix-build-602b109e1b1e/output/riscv64-linux-gnu/bitcoin-602b109e1b1e-riscv64-linux-gnu.tar.gz
55a68bd34fe4ccaf1652fc17a4ea93ce852b2fe76e856c38350320c2ee1d5af1  guix-build-602b109e1b1e/output/x86_64-apple-darwin/SHA256SUMS.part
e85c089a25b54b00b9ccecec4f621460f20d7de1384c8edb709c0a78454b1860  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin-unsigned.dmg
1e5b11122cdbfe62d3afc8744c8f6a9a78464ced6bbb49143d2d462ff59ee52c  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin-unsigned.tar.gz
74b70db775898c625a1edc764e95b4c678c27c5f4b45535be18846083c5389ae  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin.tar.gz
3a12110dc1e25a584cbf2b2ae679830f496e6b19da2904719385e65e49550934  guix-build-602b109e1b1e/output/x86_64-linux-gnu/SHA256SUMS.part
0298722e897d1d193d3c094787f89fefc1c4682c8d937d06d02b7b240602e65a  guix-build-602b109e1b1e/output/x86_64-linux-gnu/bitcoin-602b109e1b1e-x86_64-linux-gnu-debug.tar.gz
b68cdfcb71e4fee7c2d8b84920635d8b9884d7e695cf769b53266efb054f9dd6  guix-build-602b109e1b1e/output/x86_64-linux-gnu/bitcoin-602b109e1b1e-x86_64-linux-gnu.tar.gz
1ca6205f67429a0cc168addd6c019ab6418f10a8846e13241fdc198db6fc2463  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/SHA256SUMS.part
4e9e286c8a25fcb18463871d6d15d7678616009dcaeab2b122eedf6070ec45b5  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-debug.zip
4a5b7cb08c6486fe6eedb140077776af1d4dac475b55824704540aac5e2dcd76  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-setup-unsigned.exe
a9773df441af078b783ae3f939a8a0a215b6660ec44fdea7375a96b20ac7d149  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-unsigned.tar.gz
05c7a243968a53269f18a36733c24fe7aab9348b7aa260a01085d5c58e3fde1b  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64.zip

arm64:

1e3ac267ba615a4754b592252945e40a7f2796879e72116ea1f9199d9913b309  guix-build-602b109e1b1e/output/aarch64-linux-gnu/SHA256SUMS.part
355e5f6404b371d917becf2eb58cf615de709f19f2865731a60cf31269c70162  guix-build-602b109e1b1e/output/aarch64-linux-gnu/bitcoin-602b109e1b1e-aarch64-linux-gnu-debug.tar.gz
dd848b375a1f457085b531b5e8bb968e622a87b0b99a9491f77f70f22c4695f2  guix-build-602b109e1b1e/output/aarch64-linux-gnu/bitcoin-602b109e1b1e-aarch64-linux-gnu.tar.gz
646ad55b330ed30c67335e220271d0940e7d4e2d5d8b9e937668e40c9a5d0796  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/SHA256SUMS.part
9f43027fb3fcfdd5210d235a5456002cefabefb1830a4eeab27e1fd64d4b6ea9  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/bitcoin-602b109e1b1e-arm-linux-gnueabihf-debug.tar.gz
2bbd035970596c3c571ad2c16320f3533b2c9211b42e4e84f4fee8a7bf1fa466  guix-build-602b109e1b1e/output/arm-linux-gnueabihf/bitcoin-602b109e1b1e-arm-linux-gnueabihf.tar.gz
3b9cda7d87ceb0f80ffe5ed97bb327284ad9b9768cac9b62957fab90e4e2962e  guix-build-602b109e1b1e/output/arm64-apple-darwin/SHA256SUMS.part
989acc0300e9ea069d2db13c1a5204548cd8f94991fa9373c7a3dd9ce8e5a2a9  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin-unsigned.dmg
b9f9830c4676aa9e8e29d51194d3d323f4c47858bc6ba996b47974f6a14e0a3e  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin-unsigned.tar.gz
caea2d3b41cf1ae2d74e87fdb9a2f0f493a8ef4d22eac6f5eea8d921e41a5a79  guix-build-602b109e1b1e/output/arm64-apple-darwin/bitcoin-602b109e1b1e-arm64-apple-darwin.tar.gz
ab590dfd207a1df6130b3b07db39eda1cac1bbf87911cadea1b252a9aaa80ebf  guix-build-602b109e1b1e/output/dist-archive/bitcoin-602b109e1b1e.tar.gz
b3f09e0939c29e46b77aec0d0512d17fb176c55071eaae47ff17757c02a544d9  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/SHA256SUMS.part
dd1715d4b32b23cb88d5628f8122422e0585e791733d9c938f9bb721e0f292fb  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/bitcoin-602b109e1b1e-powerpc64-linux-gnu-debug.tar.gz
cdad479cfec300acf36c02f8b499d987b47ea4782e1ac48f5a8606e6cc5537ff  guix-build-602b109e1b1e/output/powerpc64-linux-gnu/bitcoin-602b109e1b1e-powerpc64-linux-gnu.tar.gz
eb7342cf9859e4d88a4677f02b5f358d368cc355d9009089fadfaa154793058b  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/SHA256SUMS.part
882c23e8fade3f46a8c26068da311271f217421aa61822aa80d5a48f56c9f129  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/bitcoin-602b109e1b1e-powerpc64le-linux-gnu-debug.tar.gz
c17028bfca6edd63cb4661f7363f8c3d7b4f57dd57d095675e447d8cc7e7b390  guix-build-602b109e1b1e/output/powerpc64le-linux-gnu/bitcoin-602b109e1b1e-powerpc64le-linux-gnu.tar.gz
97456d1b72826559cfb99336dc14a6b55cc2871a845979d64c6f130f8b6034b6  guix-build-602b109e1b1e/output/riscv64-linux-gnu/SHA256SUMS.part
534f36917d3512b0d36603189d013bd12aa77271c73368f40bd5be62c8961cbc  guix-build-602b109e1b1e/output/riscv64-linux-gnu/bitcoin-602b109e1b1e-riscv64-linux-gnu-debug.tar.gz
2732d11d0197e61531f0c2b8ba2ce5d2f8eadf3794f99c411376a3fcea54936f  guix-build-602b109e1b1e/output/riscv64-linux-gnu/bitcoin-602b109e1b1e-riscv64-linux-gnu.tar.gz
55a68bd34fe4ccaf1652fc17a4ea93ce852b2fe76e856c38350320c2ee1d5af1  guix-build-602b109e1b1e/output/x86_64-apple-darwin/SHA256SUMS.part
e85c089a25b54b00b9ccecec4f621460f20d7de1384c8edb709c0a78454b1860  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin-unsigned.dmg
1e5b11122cdbfe62d3afc8744c8f6a9a78464ced6bbb49143d2d462ff59ee52c  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin-unsigned.tar.gz
74b70db775898c625a1edc764e95b4c678c27c5f4b45535be18846083c5389ae  guix-build-602b109e1b1e/output/x86_64-apple-darwin/bitcoin-602b109e1b1e-x86_64-apple-darwin.tar.gz
3a12110dc1e25a584cbf2b2ae679830f496e6b19da2904719385e65e49550934  guix-build-602b109e1b1e/output/x86_64-linux-gnu/SHA256SUMS.part
0298722e897d1d193d3c094787f89fefc1c4682c8d937d06d02b7b240602e65a  guix-build-602b109e1b1e/output/x86_64-linux-gnu/bitcoin-602b109e1b1e-x86_64-linux-gnu-debug.tar.gz
b68cdfcb71e4fee7c2d8b84920635d8b9884d7e695cf769b53266efb054f9dd6  guix-build-602b109e1b1e/output/x86_64-linux-gnu/bitcoin-602b109e1b1e-x86_64-linux-gnu.tar.gz
1ca6205f67429a0cc168addd6c019ab6418f10a8846e13241fdc198db6fc2463  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/SHA256SUMS.part
4e9e286c8a25fcb18463871d6d15d7678616009dcaeab2b122eedf6070ec45b5  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-debug.zip
4a5b7cb08c6486fe6eedb140077776af1d4dac475b55824704540aac5e2dcd76  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-setup-unsigned.exe
a9773df441af078b783ae3f939a8a0a215b6660ec44fdea7375a96b20ac7d149  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64-unsigned.tar.gz
05c7a243968a53269f18a36733c24fe7aab9348b7aa260a01085d5c58e3fde1b  guix-build-602b109e1b1e/output/x86_64-w64-mingw32/bitcoin-602b109e1b1e-win64.zip

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 6, 2022

Guix builds

File commit 5b3f05b
(master)
commit fddf8e8
(master and this pull)
SHA256SUMS.part 706089b6b11ecdb2... 52f56f46581169af...
*-aarch64-linux-gnu-debug.tar.gz e1fa33e1a7979c34... 8ac4db651c84643c...
*-aarch64-linux-gnu.tar.gz c25a114fe6cac364... 81ca475e6680cf89...
*-arm-linux-gnueabihf-debug.tar.gz 3305270a1558a553... 57ae0f54d7c94f69...
*-arm-linux-gnueabihf.tar.gz 4d54de6c3919cf7b... acdab786de1cb148...
*-arm64-apple-darwin-unsigned.dmg 42d027a98478a902... 3895e2e5f60e3372...
*-arm64-apple-darwin-unsigned.tar.gz 2dbee77f274308f8... 5530808ad725392d...
*-arm64-apple-darwin.tar.gz 563efa87eb429f3a... 35a183750da63daa...
*-powerpc64-linux-gnu-debug.tar.gz 9c587ac9150099ad... 5a7e3e80d6ebbf6d...
*-powerpc64-linux-gnu.tar.gz 49442fbc7ae8fc3c... 5bbdfc79d4ae3fe7...
*-powerpc64le-linux-gnu-debug.tar.gz 5f7dbc5ea3da6f07... d161f2c4799c41c2...
*-powerpc64le-linux-gnu.tar.gz 058af730c2172104... 1daed251cd0200e5...
*-riscv64-linux-gnu-debug.tar.gz 2b5a6e1a29431254... ac52f34a006735cb...
*-riscv64-linux-gnu.tar.gz 79bb89966984839c... 500c250665970117...
*-win64-debug.zip c7aa3072a10d5d56... 9fde3c34d00e38c0...
*-win64-setup-unsigned.exe 405cae6c12587349... c14b7f72af7434be...
*-win64-unsigned.tar.gz 5fd1abbe0a80bb1b... db33c2e7e9c97bfc...
*-win64.zip cf93174ac5b82cb6... 567aa49a9e743fea...
*-x86_64-apple-darwin-unsigned.dmg 96b3c0c3642dabcc... f968d95b18eb12bf...
*-x86_64-apple-darwin-unsigned.tar.gz daa2968eb9aba880... 7770efe10d0735f5...
*-x86_64-apple-darwin.tar.gz dc03dd87ce545405... 442b8161afeab2cc...
*-x86_64-linux-gnu-debug.tar.gz bd05c935796d3383... f27858db65963a17...
*-x86_64-linux-gnu.tar.gz 572fc2a172e086b3... 99773529292d8536...
*.tar.gz 1db71ddab37fcd41... 176e085f725adaca...
guix_build.log be10bef000589d16... 61a37b399b4b5d2a...
guix_build.log.diff eddcbd1f0c493131...

@hebasto
Copy link
Member

hebasto commented Dec 6, 2022

Why are other recommended options--SQLITE_LIKE_DOESNT_MATCH_BLOBS, SQLITE_MAX_EXPR_DEPTH=0, SQLITE_OMIT_DECLTYPE, SQLITE_OMIT_PROGRESS_CALLBACK, SQLITE_USE_ALLOCA, SQLITE_OMIT_AUTOINIT--omitted?

They fit well with our codebase, don't they?

See https://www.sqlite.org/compile.html.

DSQLITE_DQS
> This setting disables the double-quoted string literal misfeature.

DSQLITE_DEFAULT_MEMSTATUS
> This setting causes the sqlite3_status() interfaces that track
> memory usage to be disabled.
> This helps the sqlite3_malloc() routines run much faster, and since
> SQLite uses sqlite3_malloc() internally, this helps to make the
> entire library faster.

DSQLITE_OMIT_DEPRECATED
> Omitting deprecated interfaces and features will not help SQLite
> to run any faster.
> It will reduce the library footprint, however. And it is the
> right thing to do.

DSQLITE_OMIT_SHARED_CACHE
> Omitting the possibility of using shared cache allows many
> conditionals in performance-critical sections of the code to be
> eliminated. This can give a noticeable improvement in performance.

Also: https://www.sqlite.org/sharedcache.html
> Shared-cache mode is an obsolete feature.
> The use of shared-cache mode is discouraged.
> Most use cases for shared-cache are better served by WAL mode.
> Applications that build their own copy of SQLite from source code
> are encouraged to use the -DSQLITE_OMIT_SHARED_CACHE compile-time
> option, as the resulting binary will be both smaller and faster.

DSQLITE_OMIT_JSON
Starting with sqlite 3.38.0 the JSON extension became opt-out rather
than opt-in, so we disable it here.

--disable-rtree
> An R-Tree is a special index that is designed for doing range queries.
> R-Trees are most commonly used in geospatial systems...
https://www.sqlite.org/rtree.html

--disable-fts4 --disable-fts5
> FTS5 is an SQLite virtual table module that provides full-text
> search functionality to database applications.

DSQLITE_LIKE_DOESNT_MATCH_BLOBS
> simplifies the implementation of the LIKE optimization and allows
> queries that use the LIKE optimization to run faster.

DSQLITE_OMIT_DECLTYPE
> By omitting the (seldom-needed) ability to return the declared type of
> columns from the result set of query, prepared statements can be made
> to consume less memory.

DSQLITE_OMIT_PROGRESS_CALLBACK
> By omitting this interface, a single conditional is removed from the
> inner loop of the bytecode engine, helping SQL statements to run slightly
> faster.

DSQLITE_OMIT_AUTOINIT
> with the SQLITE_OMIT_AUTOINIT option, the automatic initialization is omitted.
> This helps many API calls to run a little faster
> it also means that the application must call sqlite3_initialize()
manually.
@fanquake fanquake force-pushed the sqlite3_reccomended_compile_opts branch from 602b109 to dee6902 Compare January 23, 2023 10:26
@fanquake
Copy link
Member Author

Why are other recommended options

I've pushed up a change with some additional options included.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK dee6902, I have reviewed the code and it looks OK.

Going to provide Guix build hashes shortly.

@DrahtBot
Copy link
Contributor

Guix builds

File commit a8c1ea5
(master)
commit 2fb1c98
(master and this pull)
SHA256SUMS.part 9cf984756e3076b3... dfa5a700a7fa1cf4...
*-aarch64-linux-gnu-debug.tar.gz 1b0c2ee59be8b79c... f79814e5b65dbdbd...
*-aarch64-linux-gnu.tar.gz 7fa52f60bf4b4966... febcfca6223eb9c5...
*-arm-linux-gnueabihf-debug.tar.gz 523cce2135e7bce8... b01b2e656d01ef9b...
*-arm-linux-gnueabihf.tar.gz 2e5d91005069938a... 74c0180ffc1d7d6e...
*-arm64-apple-darwin-unsigned.dmg 93c03d9ea530bd5e... 43c0a4237f545ab4...
*-arm64-apple-darwin-unsigned.tar.gz 8825ed64a5567239... 251a5d5e5c947f3b...
*-arm64-apple-darwin.tar.gz 96f11b88b596779a... 3a710ba16680eea8...
*-powerpc64-linux-gnu-debug.tar.gz 498a1c832d9af5aa... ccbe25b0c2292056...
*-powerpc64-linux-gnu.tar.gz ecef8cd2316df970... 0d571930c23311cf...
*-powerpc64le-linux-gnu-debug.tar.gz 88594c6566f91b71... ffad96e686379566...
*-powerpc64le-linux-gnu.tar.gz ec6d5a84000ab842... 74a17af1c8906496...
*-riscv64-linux-gnu-debug.tar.gz 9fdb059b044f19a6... fbcc149715e2a7c9...
*-riscv64-linux-gnu.tar.gz 9e824293a0cf5a0c... a8648e9eb408c1d4...
*-win64-debug.zip df78dbeffa0d0470... d44b7f1f54b659f0...
*-win64-setup-unsigned.exe 4f1edfc366dd5863... 37542d0622e3bdfe...
*-win64-unsigned.tar.gz 496ef75db8092c79... 428be00c75f3722c...
*-win64.zip 615fbe7a8a5c0072... 8a65bc2edb07fd01...
*-x86_64-apple-darwin-unsigned.dmg b56251ff9fa0ad6d... f0111adb2002dc90...
*-x86_64-apple-darwin-unsigned.tar.gz 31b1365b94a02e65... 1a17f7833128c3b8...
*-x86_64-apple-darwin.tar.gz c55f6ae74e0e0b8d... 5619d1d0fc91d7bb...
*-x86_64-linux-gnu-debug.tar.gz 4cc19ff89d1d63b6... 29f2cc7ebaa5a683...
*-x86_64-linux-gnu.tar.gz 8832829a5790c8c9... be13b7a23d137608...
*.tar.gz 5f7e44ab0f9e0acf... 156d17279c7899b4...
guix_build.log 0ec4413ccb71a337... 90ff4b0ad6c33a75...
guix_build.log.diff 0245ea9a93f98e3b...

@Sjors
Copy link
Member

Sjors commented Jan 24, 2023

tACK dee6902

I checked the new flags against the docs and they seem sane.

Did some light testing with the Windows, macOS and Linux Guix builds, as well as a regular (debug) depends build on macOS.

DSQLITE_OMIT_AUTOINIT means we have to make sure to call sqlite3_initialize(). The SQLiteDatabase constructor does that, so that seems safe enough.

Guix hashes for the platforms I built:

a71685a3ff62fbf456fc1d3c0f78ab7ab1d5a4a094c1f43d3829730d65a3ec51  guix-build-dee690257c79/output/dist-archive/bitcoin-dee690257c79.tar.gz
b53fe650f431e394a5af6bd809401551e3c36e4f7d90c31f39f51c5fe236efaf  guix-build-dee690257c79/output/x86_64-apple-darwin/SHA256SUMS.part
b35b4ae345a625e42b8315acd9b75bb651f60265f67ec6f7d78a41c8d21c635e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.dmg
6748e4c64ae069632624cbec20de7f03eca1a7578fcef96607f3e8cb0ac4106e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.tar.gz
6415cbecfa18002a1e4865b996268558b4f26121118fd73b0ef4ca44967f34c7  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin.tar.gz
f0a8d8837e80e42b5d77c3efc9d746c11ffc9909aece16dcba0a10726e1be7e0  guix-build-dee690257c79/output/x86_64-linux-gnu/SHA256SUMS.part
418f4607159387ee17657120beda1c741fa6060e4457b304b857aa6c33859e6a  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu-debug.tar.gz
d384fe8f2d6515c256a371ad84ae76ac9727ffd49887c0e22bb5ada4cd890092  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu.tar.gz
3f441eb2d68ddd530b32f56a16ff639b27dcc58b5ba395e40f4c2be805f6cd8b  guix-build-dee690257c79/output/x86_64-w64-mingw32/SHA256SUMS.part
d3d22479adc554ced965c4bde79f4c919e6b216acfca598fac4ebfc3b0e2d39d  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-debug.zip
89de153f5d839df6cd1266f8b3cb3ad455b2f6c43cee7644889da1e3efc7b2f1  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-setup-unsigned.exe
ba30708b9551b3794e4d2726aff27775dd4f1b347ea71b3fe1b00e39e8b7a594  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-unsigned.tar.gz
ab6a2b7a3e899fc58030a44b555e449d64aa69b5215d761bc550946b14f93515  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64.zip

@hebasto
Copy link
Member

hebasto commented Jan 24, 2023

Guix builds:

04626ec7b64086103bfb5537397d7953d0699b31da1b1bc100003c7d30991fdf  guix-build-dee690257c79/output/aarch64-linux-gnu/SHA256SUMS.part
a77c72052266788e890a0d3d89cc6eee9dd72db6a1b6fdc8aab882b35a315284  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu-debug.tar.gz
86d782f185ee0fae8e8733ab8a511de2ca2500f02eb3d4aaa20d65b4434dcd77  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu.tar.gz
d81874ecd378470b01a429f2a4be07fcb4824b56ace146226b77088cc3c41baa  guix-build-dee690257c79/output/arm-linux-gnueabihf/SHA256SUMS.part
8f24076800e5a19ac9005af8c6e4987b32e0a857a83af84931958505228ef58d  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf-debug.tar.gz
b913f2b0d8f0e32a176bc0e9330106cf1973afe6e8ee955f3eeb89918ab9d565  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf.tar.gz
034b47d8a60a19391e0e18f6fcc8fb3a87be78a9707e3ac3e7ee45eb37687bb7  guix-build-dee690257c79/output/arm64-apple-darwin/SHA256SUMS.part
9efc5c0ceac05f6efce03fcde0cbe8b79bae43fe0d98aecb817908e76f5c39b7  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.dmg
a549cdcbd311d9b025971b13987290f6cd2b93e16c8389e8a7a2ccd3608326ed  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.tar.gz
3dd9e26a41596151022aa4288d778dc335a2b38bd391e3f65c0575dd6eb47b54  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin.tar.gz
a71685a3ff62fbf456fc1d3c0f78ab7ab1d5a4a094c1f43d3829730d65a3ec51  guix-build-dee690257c79/output/dist-archive/bitcoin-dee690257c79.tar.gz
d5c74167b2260b7de72fdbac77eedacbbb929214e279e07f41c3236ea20116b6  guix-build-dee690257c79/output/powerpc64-linux-gnu/SHA256SUMS.part
03c043daa971f70886805c9e4174acd600e5cda03ae0e827043c4df81a6a6426  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu-debug.tar.gz
3884423f67d48f671a90169962f9568dcbd8df582cd269df29a4399dc9c70e99  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu.tar.gz
cee2847d4feeadebfdf4d37110faafa250824c68cfefc3bfa289ae8b09599a20  guix-build-dee690257c79/output/powerpc64le-linux-gnu/SHA256SUMS.part
ca9f1085184b50e7bd377b68a58afd42ac4055ffe214eede8c6ca7291e00b45a  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu-debug.tar.gz
b9cadff5b30244f6cb4f277e1ac610841332cb0d732637fe438fd51c88adf5a4  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu.tar.gz
db6e45d9fc8868e5cb25fa3d0789247db10a6bab2a6f3866a27d641ae00bd03b  guix-build-dee690257c79/output/riscv64-linux-gnu/SHA256SUMS.part
751e90c0aefa249f175c0c1707dc5eee3637e2b9657a9ee1b2068479e9830ff0  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu-debug.tar.gz
8dd87bb24f1fbdba67fb6b72ab5fc93532452eada8c2942463100b8ed8118ae3  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu.tar.gz
b53fe650f431e394a5af6bd809401551e3c36e4f7d90c31f39f51c5fe236efaf  guix-build-dee690257c79/output/x86_64-apple-darwin/SHA256SUMS.part
b35b4ae345a625e42b8315acd9b75bb651f60265f67ec6f7d78a41c8d21c635e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.dmg
6748e4c64ae069632624cbec20de7f03eca1a7578fcef96607f3e8cb0ac4106e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.tar.gz
6415cbecfa18002a1e4865b996268558b4f26121118fd73b0ef4ca44967f34c7  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin.tar.gz
f0a8d8837e80e42b5d77c3efc9d746c11ffc9909aece16dcba0a10726e1be7e0  guix-build-dee690257c79/output/x86_64-linux-gnu/SHA256SUMS.part
418f4607159387ee17657120beda1c741fa6060e4457b304b857aa6c33859e6a  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu-debug.tar.gz
d384fe8f2d6515c256a371ad84ae76ac9727ffd49887c0e22bb5ada4cd890092  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu.tar.gz
3f441eb2d68ddd530b32f56a16ff639b27dcc58b5ba395e40f4c2be805f6cd8b  guix-build-dee690257c79/output/x86_64-w64-mingw32/SHA256SUMS.part
d3d22479adc554ced965c4bde79f4c919e6b216acfca598fac4ebfc3b0e2d39d  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-debug.zip
89de153f5d839df6cd1266f8b3cb3ad455b2f6c43cee7644889da1e3efc7b2f1  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-setup-unsigned.exe
ba30708b9551b3794e4d2726aff27775dd4f1b347ea71b3fe1b00e39e8b7a594  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-unsigned.tar.gz
ab6a2b7a3e899fc58030a44b555e449d64aa69b5215d761bc550946b14f93515  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64.zip

@hebasto
Copy link
Member

hebasto commented Jan 24, 2023

@Sjors

tACK 8427128

Wrong commit?

@Sjors
Copy link
Member

Sjors commented Jan 24, 2023

@Sjors

tACK 8427128

Wrong commit?

Yes, that was the previous version. But I did use the new version for testing, fixed the ACK.

@maflcko maflcko added the Wallet label Jan 24, 2023
@achow101
Copy link
Member

ACK dee6902

@achow101 achow101 merged commit 50ac8f5 into bitcoin:master Jan 24, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 24, 2023
…ded options

dee6902 build: pass --enable-debug to sqlite when DEBUG=1 (fanquake)
807b61f build: use more recommended sqlite3 compile options (fanquake)

Pull request description:

  https://www.sqlite.org/compile.html

  [SQLITE_DQS](https://www.sqlite.org/compile.html#dqs)
  > This setting disables the double-quoted string literal misfeature.

  [SQLITE_DEFAULT_MEMSTATUS](https://www.sqlite.org/compile.html#default_memstatus)
  > This setting causes the sqlite3_status() interfaces that track
  > memory usage to be disabled.
  > This helps the sqlite3_malloc() routines run much faster, and since
  > SQLite uses sqlite3_malloc() internally, this helps to make the
  > entire library faster.

  [SQLITE_OMIT_DEPRECATED](https://www.sqlite.org/compile.html#omit_deprecated)
  > Omitting deprecated interfaces and features will not help SQLite
  > to run any faster.
  > It will reduce the library footprint, however. And it is the
  > right thing to do.

  [SQLITE_OMIT_SHARED_CACHE](https://www.sqlite.org/compile.html#omit_shared_cache)
  > Omitting the possibility of using shared cache allows many
  > conditionals in performance-critical sections of the code to be
  > eliminated. This can give a noticeable improvement in performance.

  Also: https://www.sqlite.org/sharedcache.html
  > Shared-cache mode is an obsolete feature.
  > The use of shared-cache mode is discouraged.
  > Most use cases for shared-cache are better served by WAL mode.
  > Applications that build their own copy of SQLite from source code
  > are encouraged to use the -DSQLITE_OMIT_SHARED_CACHE compile-time
  > option, as the resulting binary will be both smaller and faster.

  [SQLITE_OMIT_JSON](https://www.sqlite.org/compile.html#omit_json)
  > Starting with sqlite 3.38.0 the JSON extension became opt-out rather
  than opt-in, so we disable it here.

  --disable-rtree
  > An R-Tree is a special index that is designed for doing range queries.
  > R-Trees are most commonly used in geospatial systems...
  https://www.sqlite.org/rtree.html

  --disable-fts4 --disable-fts5
  > FTS5 is an SQLite virtual table module that provides full-text
  > search functionality to database applications.

  DSQLITE_LIKE_DOESNT_MATCH_BLOBS
  > simplifies the implementation of the LIKE optimization and allows
  > queries that use the LIKE optimization to run faster.

  DSQLITE_OMIT_DECLTYPE
  > By omitting the (seldom-needed) ability to return the declared type of
  > columns from the result set of query, prepared statements can be made
  > to consume less memory.

  DSQLITE_OMIT_PROGRESS_CALLBACK
  > By omitting this interface, a single conditional is removed from the
  > inner loop of the bytecode engine, helping SQL statements to run slightly
  > faster.

  DSQLITE_OMIT_AUTOINIT
  > with the SQLITE_OMIT_AUTOINIT option, the automatic initialization is omitted.
  > This helps many API calls to run a little faster
  > it also means that the application must call sqlite3_initialize()
  manually.

  On my Linux box this results in a `libsqlite3.a` that shrinks from ~1.7mb to ~1.3mb.
  On macOS, `libsqlite3.a` shrinks from ~2.2mb to ~1.3mb.

  Guix Build:
  ```bash
  04626ec7b64086103bfb5537397d7953d0699b31da1b1bc100003c7d30991fdf  guix-build-dee690257c79/output/aarch64-linux-gnu/SHA256SUMS.part
  a77c72052266788e890a0d3d89cc6eee9dd72db6a1b6fdc8aab882b35a315284  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu-debug.tar.gz
  86d782f185ee0fae8e8733ab8a511de2ca2500f02eb3d4aaa20d65b4434dcd77  guix-build-dee690257c79/output/aarch64-linux-gnu/bitcoin-dee690257c79-aarch64-linux-gnu.tar.gz
  d81874ecd378470b01a429f2a4be07fcb4824b56ace146226b77088cc3c41baa  guix-build-dee690257c79/output/arm-linux-gnueabihf/SHA256SUMS.part
  8f24076800e5a19ac9005af8c6e4987b32e0a857a83af84931958505228ef58d  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf-debug.tar.gz
  b913f2b0d8f0e32a176bc0e9330106cf1973afe6e8ee955f3eeb89918ab9d565  guix-build-dee690257c79/output/arm-linux-gnueabihf/bitcoin-dee690257c79-arm-linux-gnueabihf.tar.gz
  034b47d8a60a19391e0e18f6fcc8fb3a87be78a9707e3ac3e7ee45eb37687bb7  guix-build-dee690257c79/output/arm64-apple-darwin/SHA256SUMS.part
  9efc5c0ceac05f6efce03fcde0cbe8b79bae43fe0d98aecb817908e76f5c39b7  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.dmg
  a549cdcbd311d9b025971b13987290f6cd2b93e16c8389e8a7a2ccd3608326ed  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin-unsigned.tar.gz
  3dd9e26a41596151022aa4288d778dc335a2b38bd391e3f65c0575dd6eb47b54  guix-build-dee690257c79/output/arm64-apple-darwin/bitcoin-dee690257c79-arm64-apple-darwin.tar.gz
  a71685a3ff62fbf456fc1d3c0f78ab7ab1d5a4a094c1f43d3829730d65a3ec51  guix-build-dee690257c79/output/dist-archive/bitcoin-dee690257c79.tar.gz
  d5c74167b2260b7de72fdbac77eedacbbb929214e279e07f41c3236ea20116b6  guix-build-dee690257c79/output/powerpc64-linux-gnu/SHA256SUMS.part
  03c043daa971f70886805c9e4174acd600e5cda03ae0e827043c4df81a6a6426  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu-debug.tar.gz
  3884423f67d48f671a90169962f9568dcbd8df582cd269df29a4399dc9c70e99  guix-build-dee690257c79/output/powerpc64-linux-gnu/bitcoin-dee690257c79-powerpc64-linux-gnu.tar.gz
  cee2847d4feeadebfdf4d37110faafa250824c68cfefc3bfa289ae8b09599a20  guix-build-dee690257c79/output/powerpc64le-linux-gnu/SHA256SUMS.part
  ca9f1085184b50e7bd377b68a58afd42ac4055ffe214eede8c6ca7291e00b45a  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu-debug.tar.gz
  b9cadff5b30244f6cb4f277e1ac610841332cb0d732637fe438fd51c88adf5a4  guix-build-dee690257c79/output/powerpc64le-linux-gnu/bitcoin-dee690257c79-powerpc64le-linux-gnu.tar.gz
  db6e45d9fc8868e5cb25fa3d0789247db10a6bab2a6f3866a27d641ae00bd03b  guix-build-dee690257c79/output/riscv64-linux-gnu/SHA256SUMS.part
  751e90c0aefa249f175c0c1707dc5eee3637e2b9657a9ee1b2068479e9830ff0  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu-debug.tar.gz
  8dd87bb24f1fbdba67fb6b72ab5fc93532452eada8c2942463100b8ed8118ae3  guix-build-dee690257c79/output/riscv64-linux-gnu/bitcoin-dee690257c79-riscv64-linux-gnu.tar.gz
  b53fe650f431e394a5af6bd809401551e3c36e4f7d90c31f39f51c5fe236efaf  guix-build-dee690257c79/output/x86_64-apple-darwin/SHA256SUMS.part
  b35b4ae345a625e42b8315acd9b75bb651f60265f67ec6f7d78a41c8d21c635e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.dmg
  6748e4c64ae069632624cbec20de7f03eca1a7578fcef96607f3e8cb0ac4106e  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin-unsigned.tar.gz
  6415cbecfa18002a1e4865b996268558b4f26121118fd73b0ef4ca44967f34c7  guix-build-dee690257c79/output/x86_64-apple-darwin/bitcoin-dee690257c79-x86_64-apple-darwin.tar.gz
  f0a8d8837e80e42b5d77c3efc9d746c11ffc9909aece16dcba0a10726e1be7e0  guix-build-dee690257c79/output/x86_64-linux-gnu/SHA256SUMS.part
  418f4607159387ee17657120beda1c741fa6060e4457b304b857aa6c33859e6a  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu-debug.tar.gz
  d384fe8f2d6515c256a371ad84ae76ac9727ffd49887c0e22bb5ada4cd890092  guix-build-dee690257c79/output/x86_64-linux-gnu/bitcoin-dee690257c79-x86_64-linux-gnu.tar.gz
  3f441eb2d68ddd530b32f56a16ff639b27dcc58b5ba395e40f4c2be805f6cd8b  guix-build-dee690257c79/output/x86_64-w64-mingw32/SHA256SUMS.part
  d3d22479adc554ced965c4bde79f4c919e6b216acfca598fac4ebfc3b0e2d39d  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-debug.zip
  89de153f5d839df6cd1266f8b3cb3ad455b2f6c43cee7644889da1e3efc7b2f1  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-setup-unsigned.exe
  ba30708b9551b3794e4d2726aff27775dd4f1b347ea71b3fe1b00e39e8b7a594  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64-unsigned.tar.gz
  ab6a2b7a3e899fc58030a44b555e449d64aa69b5215d761bc550946b14f93515  guix-build-dee690257c79/output/x86_64-w64-mingw32/bitcoin-dee690257c79-win64.zip
  ```

ACKs for top commit:
  Sjors:
    tACK dee6902
  achow101:
    ACK dee6902
  hebasto:
    ACK dee6902, I have reviewed the code and it looks OK.

Tree-SHA512: e0605f049404905db94ea61473b2b68df008ceb86b9a09d8562ca3acc1f3a3be3893149fc62d189a6fbf24cfc76c393f2d1a1215292e9ae5dc4afc199e876821
@fanquake fanquake deleted the sqlite3_reccomended_compile_opts branch January 25, 2023 09:32
@bitcoin bitcoin locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants