You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: skip page cache allocation for BrowserDb (WASM/IndexedDB backend) #275
BrowserDb::open_in_memory(), BrowserDb::open(), and BrowserDb::import_graph() all call PersistentFactStorage::new(buffer, 256) with a 256-page capacity. The backend is BrowserBufferBackend — an in-memory HashMap<u64, Vec<u8>> that pre-loads all pages from IndexedDB at open time. Every subsequent page read is a RAM-to-RAM copy through the LRU cache, which adds HashMap overhead for zero benefit.
Related
Companion to #274 (same issue for native in-memory databases). Fix location is different — src/browser/mod.rs lines 54, 79, 219.
Proposed fix
Pass 0 as the page_cache_capacity argument to PersistentFactStorage::new in all three BrowserDb constructors. BrowserBufferBackend is already a page cache; the PageCache layer is redundant.
Acceptance criteria
BrowserDb::open_in_memory(), BrowserDb::open(), and BrowserDb::import_graph() pass 0 as page cache capacity.
All existing browser WASM tests pass unchanged.
OpenOptions::page_cache_size documentation notes it is native file-backed only.
Activity
perf: skip redundant page cache allocation in BrowserDb (#275) (#342)