diff --git a/docs/documentation-database.md b/docs/documentation-database.md index 566703ad1b..a0badff4fc 100644 --- a/docs/documentation-database.md +++ b/docs/documentation-database.md @@ -69,7 +69,9 @@ CREATE TABLE Tooltips ( ## How CoGo talks to this database -All three sites below open the file with `SQLiteDatabase.openDatabase(..., OPEN_READONLY)` — no writes, ever, from this app (see ADR 0001 for why raw SQLite is justified here instead of Room). +The two read paths below — `WebServer` and `ToolTipManager` — open the file with `SQLiteDatabase.openDatabase(..., OPEN_READONLY)`; only `PluginDocumentationManager` opens it `OPEN_READWRITE`, to merge in plugin-contributed content (see ADR 0001 for why raw SQLite is justified here instead of Room). + +None of them enable SQLite's memory-mapped IO. It was implemented and benchmarked under ADFA-4979, then removed: ADFA-5136 measured it on an arm64 device across small random page reads, large PDFs, and a sustained 3000-page walk, at both 1 KB and 2 KB page sizes, and found no read-time improvement in any configuration — response time is dominated by Brotli decode and Pebble rendering, not by `read()`. Mapping the whole file did cost about 100 MB of resident mapped pages during a single walk touching roughly a tenth of the corpus, since mapped pages sit outside `cache_size`'s bound. Don't re-add it without a measurement that contradicts those numbers; if it ever returns, cap the request rather than mapping the whole file, and note that I/O errors against a mapped file surface as an uncatchable SIGBUS rather than a `SQLiteException`. - **`app/.../localWebServer/WebServer.kt`** — serves Tier 3. On each `GET`, runs: