Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Investigate performance-enhancing database schema changes #6334

Open
14 tasks
friedbunny opened this issue Sep 14, 2016 · 4 comments
Open
14 tasks

Investigate performance-enhancing database schema changes #6334

friedbunny opened this issue Sep 14, 2016 · 4 comments
Labels
Core The cross-platform C++ core, aka mbgl offline performance Speed, stability, CPU usage, memory usage, or power usage

Comments

@friedbunny
Copy link
Contributor

friedbunny commented Sep 14, 2016

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).

#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?

  • Profile memory usage
    • iOS
    • Android
  • Write and expand tests
  • Understand the causes of temp file usage under our usage patterns, and the implications of keeping this temp storage in memory
  • Understand what SQLite state is global and shared with application-level database connections.
  • Hands-on testing on all platforms
    • Android
    • iOS
    • macOS
    • Node
    • Qt
  • Add a benchmark test using gbenchmark (./benchmark/...`)
  • Your checkbox here

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

@friedbunny friedbunny added performance Speed, stability, CPU usage, memory usage, or power usage offline Core The cross-platform C++ core, aka mbgl needs discussion labels Sep 14, 2016
@jfirebaugh
Copy link
Contributor

👍 I added a couple bullet points above.

@tmpsantos
Copy link
Contributor

Added some more...

@stale
Copy link

stale bot commented Nov 20, 2018

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 stale bot closed this as completed Nov 20, 2018
@friedbunny friedbunny reopened this Nov 20, 2018
@stale stale bot removed the archived Archived because of inactivity label Nov 20, 2018
@stale stale bot added the archived Archived because of inactivity label May 19, 2019
@stale
Copy link

stale bot commented May 19, 2019

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 stale bot closed this as completed May 19, 2019
@friedbunny friedbunny reopened this May 20, 2019
@stale stale bot removed the archived Archived because of inactivity label May 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl offline performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

3 participants