mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Investigate performance-enhancing database schema changes #6334

Open friedbunny opened 8 years ago

friedbunny commented 8 years ago

The offline/ambient cache SQLite database currently uses journal_mode = DELETE and synchronous = FULL pragmas. These modes are safe and have proven reasonably reliable, but they are slow.

We briefly moved to WAL + NORMAL (#5796) and saw increased speed, but that ended up being short-lived as it provoked bad behavior on Android (#6193) and was reverted out of prudence (#6320).

https://github.com/mapbox/mapbox-gl-native/pull/6319 presented a way to avoid the Android file permission issue by switching to in-memory temporary stores. This would purportedly bring its own speed improvements, but also a variety of unknowns — so we tabled it.

To a glorious future

After more research and testing, I’d like to bring back these changes:

PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA temp_store = MEMORY;

So what do we need to feel confident about another schema change?

/cc @mapbox/mobile @kkaefer @tmpsantos @brunoabinader @mikemorris

jfirebaugh commented 8 years ago

👍 I added a couple bullet points above.

tmpsantos commented 8 years ago

Added some more...

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.