Closed Bug 1677399 Opened 4 years ago Closed 4 years ago

CRLite uses 25% of CPU once per minute

Categories

(Core :: Security: PSM, defect, P1)

Firefox 84
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox82 --- unaffected
firefox83 --- unaffected
firefox84 --- fixed
firefox85 --- fixed

People

(Reporter: bit, Assigned: keeler)

References

(Blocks 1 open bug)

Details

(Whiteboard: [psm-assigned])

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

I was just using Firefox Nightly as usual. Last build, Windows 10 x64.
I noticed strange periodical CPU usage.

Actual results:

Once per minute Firefox was using 25% CPU for some time (see attached screenshot). I checked what it was doing. There was some I/O using, \AppData\Roaming\Mozilla\Firefox\Profiles\<profile>\security_state\crlite.stash file in particular.
All is OK with new test profile.

Firefox Profiler results: https://share.firefox.dev/3f697LF

Expected results:

There should not be this unusual CPU usage.

This patch uses nsICertStorage.hasPriorData() and a new local field on the
CRLite filter Remote Settings collection to avoid re-downloading and
re-processing CRLite filters and stashes that have already been put into
cert_storage.

Assignee: nobody → dkeeler
Severity: -- → S1
Priority: -- → P1
Whiteboard: [psm-assigned]
Attached image image.png

It's permanent now.
This is the latest build at the moment, 20201119095716.

Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c1fe88096bb3
avoid re-downloading and re-processing CRLite filters/stashes that are already in cert_storage r=bbeurdouche
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Will this be backported to Firefox 84?
Reducing CPU usage might be especially important especially with recent Chrome blog posts like https://blog.chromium.org/2020/11/tab-throttling-and-more-performance.html.

Flags: needinfo?(dkeeler)

Yes - this isn't enabled in release yet, but it will affect early betas.

Out of curiosity, timitbit, what is the value of services.settings.poll_interval in about:config?

Flags: needinfo?(dkeeler) → needinfo?(bit)

Comment on attachment 9188457 [details]
Bug 1677399 - avoid re-downloading and re-processing CRLite filters/stashes that are already in cert_storage r?bbeurdouche

Beta/Release Uplift Approval Request

  • User impact if declined: excess cpu usage/jank on early betas
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): relatively small change, we have test coverage, and this isn't even enabled in release yet
  • String changes made/needed: none
Attachment #9188457 - Flags: approval-mozilla-beta?

(In reply to Dana Keeler (she/her) (use needinfo) (:keeler for reviews) from comment #7)

Yes - this isn't enabled in release yet, but it will affect early betas.

Out of curiosity, timitbit, what is the value of services.settings.poll_interval in about:config?

services.settings.poll_interval = 86400

Flags: needinfo?(bit)

Comment on attachment 9188457 [details]
Bug 1677399 - avoid re-downloading and re-processing CRLite filters/stashes that are already in cert_storage r?bbeurdouche

Approved for 84.0b4.

Attachment #9188457 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: