Open Bug 1643796 Opened 4 years ago Updated 2 years ago

transformNetworkEventResource is slow on Google Doc

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: Harald, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

I had Browser Console and Google Docs became extremely sluggish.

https://share.firefox.dev/2XFXeoV

transformNetworkEventResource is nearly 50% of the sample; and I didn't even show network requests in the Console.

Blocks: 1643797
No longer blocks: 1643797

(Moving to Netmonitor as that's where the costly code is)

This should be less an issue now in the Browser Console as we don't start network monitoring by default (see Bug 1764348)
Anyway, in the content toolbox I ran this (from another tab, so they would be block, but we'd still run some costly code)

for (let i = 0; i < 1000; i++) {
  fetch("https://docs.google.com/document/d/1lc0Haq3bKwAX9xtfyuDJ_g4IdyuVAgoE4eB7SJBVY-o/test?id=1lc0Haq3bKwAX9xtfyuDJ_g4IdyuVAgoE4eB7SJBVY-o&sid=7079dc4523d2b52b&token=AC4w5VgAhnrk9dvcPqHAM9lz9gjHUoO9bA%3A1655966846892&includes_info_params=true&VER=8&lsq=1655966745163&u=10364775709595042058&vc=1&c=1&w=1&flr=0&gsi=0&ssfi=5205&smv=22&cimpl=1&TYPE=xmlhttp&zx=ilon2xln1aak&t=1")
}

and getUrlDetail ran for ~500ms, which is quite important (see https://share.firefox.dev/3ydUC3B)
The URL constructor is called multiple times, which is probably something we could avoid doing

Component: Console → Netmonitor
Summary: Browser Console slows down main thread with `transformNetworkEventResource` → transformNetworkEventResource is slow on Google Doc
Flags: needinfo?(hmanilla)
You need to log in before you can comment on or make changes to this bug.