Open Bug 1956920 Opened 26 days ago Updated 11 days ago

URL classifier startup takes too long (90ms in nsUrlClassifierDBServiceWorker::OpenDb)

Categories

(Toolkit :: Safe Browsing, defect)

defect

Tracking

()

People

(Reporter: mstange, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

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

Opening the URL classifier database takes too long. The work in mozilla::safebrowsing::Classifier::Open takes 90ms on a Pixel 6. This has a large impact on our applink startup times (bug 1945906) because it delays the initial network request for the app link URL.

The profile shows that the time is spent in two places:

  • Loading the prefix list into memory hits malloc lock contention because it creates lots of small allocations. Can this be one big allocation instead?
  • The other half of the time is spent copying the file contents into memory a second time, and computing the CRC32 on those contents.

Is the CRC32 verification necessary? Does it need to happen on every startup? On Android, users switch apps frequently so it's common that Firefox gets killed in the background and has to be restarted when the user switches back to it.

I've filed bug 1956923 with a suggestion that would absorb the slow initialization time into other delays, but in the long run we should just make initialization faster.

The severity field is not set for this bug.
:dimi, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dlee)
You need to log in before you can comment on or make changes to this bug.