sm7125: 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.

Change-Id: I541709fc771d4b501b56b8555e5e8a04486d0293
urubino-microg
Jesse Chan 4 years ago committed by Ruchit
parent 8ec2b5e11f
commit 6e72b42398
  1. 30
      overlay/frameworks/base/core/res/res/values/config.xml

@ -1296,4 +1296,32 @@
<item>2</item> <!-- COLOR_MODE_SATURATED -->
<item>3</item> <!-- COLOR_MODE_AUTOMATIC -->
</integer-array>
</resources>
<!-- 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" translatable="false">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" translatable="false">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" translatable="false">OFF</string>
</resources>

Loading…
Cancel
Save