We have data showing that the Places SQLite database can consume gigabytes of I/O during Firefox test automation jobs. This is because a number of tests load pages as rapdily as possible, effectively stress testing Places and SQLite. As the SQLite database is committed to, we incur I/O for the WAL journal and when flushing/synchronizing commits. This can add up to a lot of overhead, especially on spinning disks. It is important for Places to run during many tests. But it isn't necessarily important to run with robust I/O guarantees: SQLite itself has tests that ensure different journal and synchronizing modes work as advertised. This commit introduces a preference that changes the SQLite journal and synchronization modes to be less robust. We use an in-memory journal so no I/O is incurred for journal writing. We disable synchronization during commit so no expensive file(system) flushing is performed. Because setting this preference would be dangerous for end users, we only honor the pref if a scary sounding environment variable is set. Hopefully that's enough of an obstacle to prevent people from footgunning themselves. A preliminary Try run reveals this has the potential to shave hundreds of megabytes of I/O from various jobs. Although this commit stops short of changing the configuration in automation to use the new volatile storage preference. MozReview-Commit-ID: KCoDVzwkSbg
65 KiB
65 KiB