(In reply to Emma Malysz from comment #1)
Gijs, do you have any suggestions on how we could improve this? Doug had suggested experimenting with caching or figuring out a way to improve our indices.
This will be because it's 1 db with data for multiple consumers. This is, per my discussion with Andrew earlier today, the "right" way of using indexeddb. RemoteSettings segments the data that comes out of the stores based on who the consumer is (based on idb keyranges), and indexeddb is able to optimize this, AIUI. I think there are already indices in place for listing all data for a given consumer, which is likely what we're doing here. (Mathieu, can you confirm?)
I don't really have context here. Is this the first run on this profile, or a subsequent one? Do we know which remote settings consumers are causing the IO?
I'm not sure how we'd fix this. RS is supposed to provide an intuitive API surface over a DB that is synced to a remote service. It's used by multiple consumers, and some of them run on startup and others do not. Given the ratio of the file size and read size in comment #0, caching the entire thing is clearly silly. But there's a bunch of abstractions (remote settings, indexeddb, sqlite) inbetween the consumers and the actual IO, so I'm not sure how we could reasonably cache this info. My best guess would be duplicating the data to a cache file if we notice we load it at startup, but that would be copy #3 of the data (we also ship initial dumps of a bunch of these datasets in omni.ja - but those will miss updates distributed via remote settings since then), plus we'd need to invalidate it every time the data changes, which can happen every 6 hours. Plus, 2mb is quite a significant amount of data to just duplicate in order to make the read slightly faster...
If we knew what the consumers were, we could look at whether they really need this data so early, or if they could cache the salient details some other way.
Component: General → Remote Settings Client
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(emalysz)
Product: Core → Firefox