New issue
Advanced search Search tips

Issue 901872 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Consider using SQLITE_ENABLE_BATCH_ATOMIC_WRITE from sqlite in Chrome

Project Member Reported by lizeb@chromium.org, Nov 5

Issue description

SQLITE_ENABLE_BATCH_ATOMIC_WRITE allows SQLite to write less data on disk provided that the underlying filesystem supports atomic writes.
This is currently only supported by F2FS, which is getting more and more common on Android devices.

From sqlite's documentation: https://www.sqlite.org/compile.html
"This can make transactions over twice as fast, while simultaneously reducing wear on SSD storage devices."

This seems to be enabled by default on Android since O MR1, https://android.googlesource.com/platform/external/sqlite/+/41effbb659b63b3233036011750624b5da59d0a1, with this note about performance:

"When F2FS atomic write is used, we find that transactions are about 3x
faster compared with an ext4 filesystem on the same SSD device."
 
nice find!! We do not have F2FS coverage on perf waterfall, so evaluating this seemingly small change, if so needed, may turn out to be quite involved.

Adding third_party/sqlite/OWNERS for a few questions to clarify together:

1. What metrics should we look at to determine whether it improves something?

2. This is a compile-time flag, so doing a Finch is not as convenient, would it justify not doing a Finch study? :)

PS: this could be one more reason to ask for enabling /proc/pid/io metrics on Android kernels, but that's another story..
Cc: cmumford@chromium.org pwnall@chromium.org
Actually adding third_party/sqlite/OWNERS: please see the questions above.
Labels: -Type-Bug -Pri-2 Pri-3 Type-Feature
This is actually a feature, classifying as such.

An external contributor put together https://crrev.com/c/1003012 which attempts to turn on the flag. The CL doesn't handle WebSQL's special usage of SQLite, which can be seen as LayoutTest failures. The CL seems abandoned.

1. I suspect you want Sqlite.CommitTime.* and SQLite.AutoCommitTime.*, maybe Sqlite.MemoryKB.*

2. Yeah, Finch is always painful for config changes.

I am not going to ask for a Finch trial. I think this is a net-positive, and we should do it, if we can figure out the WebSQL story.

If someone else asks you to do a Finch, you'll have to figure out how to disable batch atomic writes in SQLite's VFS layer, based on the Finch flag. I propose that we look into this after we have a CL that passes CQ (in other words, handles WebSQL) and a request for a Finch trial.

Should you need a Finch trial, https://crbug.com/875538 might be helpful.
pwnall: thanks for all the info!
Thanks pwnall@. I looked at crrev.com/c/1003012's layout test failures but didn't get much insight into what's going on. Do you have an idea of what WebSQL is doing that is causing problems?

Background: we're thinking of this for a starter project for a new hire, but only if it's not too messy.

Sign in to add a comment