Closed Bug 1746263 Opened 2 years ago Closed 2 years ago

Shortly after startup, load_crlite_stash_from_reader_into_map uses 160ms+ of CPU time calling read()

Categories

(Core :: Security: PSM, defect)

defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: mstange, Assigned: mstange)

Details

Attachments

(1 file)

I found a fun issue while doing startup profiling, and it has an easy fix.

Profile: https://share.firefox.dev/3GNKtMs

Steps to reproduce:

  1. Start Firefox with the environment variables MOZ_PROFILER_STARTUP=1 MOZ_PROFILER_STARTUP_FILTERS="GeckoMain,Background"
  2. Grab a profile.
  3. Look at the activity on the BackgroundThreadPool threads.

Expected results:
No avoidable activity.

Actual results:
More than 160ms of CPU time are spent in load_crlite_stash_from_reader_into_map, and most of that inside of a read system call. See the profile at the top of this comment.

This saves at least 140ms of CPU time during startup from repeated read calls.

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/c839cbc79a12
Use BufReader when reading the crlite stash. r=keeler
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: