stress test and optimize Service Worker Cache schema

NEW
Unassigned

Status

()

4 years ago
3 years ago

People

(Reporter: bkelly, Unassigned, NeedInfo)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

4 years ago
To date the SW Cache implementation has only had very basic testing done.  At most a handful of requests at a time.  Before releasing this on the world we should verify it doesn't fall over on more realistic workloads.

I expect most of the issues will be in the DB schema.  I have some ideas to improve things there, but want measurements to verify they are worth it:

Ideas:
* De-normalize VARY header info into a boolean column on each Cache entry.  This avoids having to touch the headers table to determine if an entry needs the more complex VARY matching logic.
* Modify queries that read entries to use bulk operations.  This would minimize index lookups.  These are fast, but still take O(log n) time each.
(Reporter)

Comment 1

4 years ago
See bug 940237 comment 110 for many excellent suggestions to investigate.
(ni'ing myself to continue my investigation I started on bug 940273)

Note that comment 1 has a bug number typo, :mak's feedback is on bug 940273 comment 110.
Flags: needinfo?(bugmail)
(Reporter)

Comment 3

4 years ago
We should do this after the prefixMatch feature is removed in bug 1130452.  This will make it much easier to use hashes for the URL and avoid TEXT column indices.
Depends on: 1130452
(Reporter)

Comment 4

4 years ago
Note that performance testing and optimization here will include FileUtils code as well.
(Reporter)

Comment 5

4 years ago
We should steal ideas from the IDB optimization bug.
(Reporter)

Comment 7

4 years ago
I converted CacheStorage keys to blobs to fix a functional issue in bug 1153245.  We should consider doing the same for other strings since we don't actually need fancy string encoding.
FYI, OpenDatabaseWithFileURL() need not always created shared cache connections; you can pass the "cache=private" option to get an unshared connection. (e.g. http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp#3556)
(Reporter)

Updated

3 years ago
Depends on: 1162211
(Reporter)

Updated

3 years ago
Depends on: 1162342
(Reporter)

Updated

3 years ago
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
(Reporter)

Updated

3 years ago
Depends on: 1166038
(Reporter)

Updated

3 years ago
Depends on: 1166911
(Reporter)

Updated

3 years ago
Depends on: 1168135
(Reporter)

Updated

3 years ago
Depends on: 1168152
(Reporter)

Updated

3 years ago
Depends on: 1173439
(Reporter)

Updated

3 years ago
Blocks: 1110136
No longer blocks: 1110144
(Reporter)

Comment 9

3 years ago
I'm not working on this at the moment.  We could do some more profiling, but this has been shipped for a while without any perf issues reported.
Assignee: bkelly → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.