Closed Bug 1866240 Opened 2 years ago Closed 2 years ago

Maintain usage information in the database for a massive speedup at startup when QuotaManager needs to initialize an origin; especially beneficial for pinned tabs

Categories

(Core :: Storage: Cache API, task, P1)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox121 --- wontfix
firefox122 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(2 files)

CacheQuotaClient::InitOrigin currently must get file size information for all stored responses. This can be extremely slow when there are thousands of files. The usage information could be maintained in the database instead.

Assignee: nobody → jvarga
Status: NEW → ASSIGNED
Priority: -- → P1
Type: enhancement → task
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0279020821f5 Maintain usage information in the database; r=dom-storage-reviewers,asuth

Backed out for causing multiple failures in test_cache_padding.html

And xpcshell failures: https://treeherder.mozilla.org/logviewer?job_id=438508244&repo=autoland

Flags: needinfo?(jvarga)
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1d035302ec62 Maintain usage information in the database; r=dom-storage-reviewers,asuth
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Flags: needinfo?(jvarga)

The telemetry for the time needed to load quota information has improved significantly after this fix. Should we consider an uplift to beta ?

Flags: needinfo?(jstutte)
Flags: needinfo?(bugmail)

I leave it to Andrew to give a risk assessment for this. The patch looks non trivial, and I assume it changes even the DB schema?

Flags: needinfo?(jstutte)

(I changed my mind about setting a tracking flag here, but the autofilled text got lodged in here)

Flags: needinfo?(bugmail)
Summary: Maintain usage information in the database → Maintain usage information in the database for a massive speedup at startup when QuotaManager needs to initialize an origin; especially beneficial for pinned tabs
Attachment #9367551 - Flags: approval-mozilla-beta?

Uplift Approval Request

  • Explanation of risk level: We have high confidence in the code as the design is intentionally simple. As noted in the impact section, though, for this major startup time improvement we are paying a one-time upgrade cost per origin. Progress will be saved if the user kills the browser.
  • Code covered by automated testing: yes
  • Risk associated with taking this patch: Low-Med.
  • Needs manual QE test: no
  • User impact if declined: Slow browser startup / delayed usability for users that use sites like spotify or gmail that can store a lot of data in Cache API storage. When we need to init the origin because it was open during the previous run of Firefox, we go from (without patch) O(number of files stored in Cache API for the origin) file size gathering to O(open 1 database) for the origin. The caveat is that an upgrade step is needed to accomplish this and that step can will fundamentally be at least as slow as the pre-patch origin init time and is likely to take longer. That said, note that: 1) this is in nightly and will be in next beta regardless, and 2) users will only notice the slowness if a site or extension does something that blocks on QuotaManager access with LocalStorage being the most likely reason.
  • Fix verified in Nightly: yes
  • Steps to reproduce for manual QE testing: n/a
  • Is Android affected?: yes
  • String changes made/needed: none

Comment on attachment 9367551 [details]
Bug 1866240 - Maintain usage information in the database; r=#dom-storage

Approved for 121.0b9.

Attachment #9367551 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

The patch for Beta is now updated and can be landed again.

Flags: needinfo?(bugmail)
Attachment #9367551 - Attachment is obsolete: true

Comment on attachment 9367551 [details]
Bug 1866240 - Maintain usage information in the database; r=#dom-storage

Sorry, but we're out of betas this cycle and I'm not comfortable taking this directly into an RC, especially with this release going out so close to the holidays. Sorry this uplift got burned by the Lando bug :(

Attachment #9367551 - Attachment is obsolete: false
Attachment #9367551 - Flags: approval-mozilla-beta+ → approval-mozilla-beta-

Ok, no problem.

Regressions: 1871799
Regressions: 1873204
Depends on: 1883353
No longer depends on: 1883353
No longer depends on: 1808294
See Also: → 1808294
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: