miatoll: overlay: Configure SQLite to operate in MEMORY mode

This change yields considerable SQLite performance gains. It
should be generally safe as this device has irremovable battery.

Some OEMs have been doing this for years.

Signed-off-by: Jesse Chan <jc@lineageos.org>
Change-Id: Ic775c3fa735a32653d8e7f4c15cac26c6ebc262c
This commit is contained in:
Jesse Chan 2018-05-04 23:36:32 -07:00 committed by Aryan Gupta
parent 51c2de8f3d
commit 1316e16ad0

View File

@ -583,4 +583,32 @@
<item>"/system/lib64/libRSCpuRef.so"</item> <item>"/system/lib64/libRSCpuRef.so"</item>
<item>"/system/lib64/libblas.so"</item> <item>"/system/lib64/libblas.so"</item>
</string-array> </string-array>
<!-- The default journal mode to use use when Write-Ahead Logging is not active.
Choices are: OFF, DELETE, TRUNCATE, PERSIST and MEMORY.
PERSIST may improve performance by reducing how often journal blocks are
reallocated (compared to truncation) resulting in better data block locality
and less churn of the storage media.
The PERSIST mode results in data persisting in the journal beyond the life of
a transaction, so it interacts poorly with SECURE_DELETE. -->
<string name="db_default_journal_mode">MEMORY</string>
<!-- The database synchronization mode when using the default journal mode.
FULL is safest and preserves durability at the cost of extra fsyncs.
NORMAL also preserves durability in non-WAL modes and uses checksums to ensure
integrity although there is a small chance that an error might go unnoticed.
Choices are: FULL, NORMAL, OFF. -->
<string name="db_default_sync_mode">OFF</string>
<!-- The database synchronization mode when using Write-Ahead Logging.
From https://www.sqlite.org/pragma.html#pragma_synchronous:
WAL mode is safe from corruption with synchronous=NORMAL, and probably DELETE mode is safe
too on modern filesystems. WAL mode is always consistent with synchronous=NORMAL, but WAL
mode does lose durability. A transaction committed in WAL mode with
synchronous=NORMAL might roll back following a power loss or system crash.
Transactions are durable across application crashes regardless of the synchronous setting
or journal mode. The synchronous=NORMAL setting is a good choice for most applications
running in WAL mode.
Choices are: FULL, NORMAL, OFF. -->
<string name="db_wal_sync_mode">OFF</string>
</resources> </resources>