Open Bug 1813805 Opened 2 years ago Updated 2 months ago

Delay introduced by AsyncUrlChannelClassifier::CheckChannel()

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

People

(Reporter: acreskey, Unassigned, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged])

We're seeing delay introduced by AsyncUrlChannelClassifier::CheckChannel() in the main thread of the parent process

A profile from M1 Max MacBook Pro:
https://share.firefox.dev/3HFoue2

It looks like all of the AsyncUrlChannelClassifier::CheckChannel - return - priority: Normal (4) runnables end up queuing up, so the later ones will be significantly delayed. Visible in this profile:
https://share.firefox.dev/3Dth4rE

This code path, from asyncOpen in the content process to transaction pending on the parent process socket thread, looks to be one of the larger sources of latency within Necko.
(See Results - [meta] Review performance telemetry/markers)

This bug is to see what can be done to optimize this.

The use of moz_log-to-profile markers has skewed these results, I'll recapture.

Flags: needinfo?(acreskey)
See Also: → 1565019

Adding observations from Randell in #necko

On cnn.com he's seeing a 27ms cost to channel classification, mostly on mutexes for memory allocation/deallocation:

So I was looking at targets for OMT, and came across some stuff in a profile that may be a performance target (not for OMT). This is from a load of cnn.com, zoomed into an early part of the load when it's pulling in a bunch of images. Note that for 27ms, we're almost solely handling ChannelClassifier runnables (see the bottom of the Marker view). On top of that, for most of that 27ms, we're waiting on mutexes for memory allocation and deallocation (strings, arrays, etc). https://share.firefox.dev/4aTt5Vn If you zoom out, you'll see other bunches of ChannelClassifier runnables.
This smells like something that can be improved and would positively impact pageload.

See Also: → 1907701
See Also: → 1911450
Blocks: 1927021
See Also: → 1927538
You need to log in before you can comment on or make changes to this bug.