Open Bug 1926128 Opened 12 days ago Updated 9 days ago

Firefox cache significantly slower than Chrome

Categories

(Core :: Networking: Cache, defect, P2)

defect
Points:
8

Tracking

()

People

(Reporter: bas.schouten, Unassigned)

Details

(Whiteboard: [necko-triaged][necko-priotity-review])

When loading hotel pages on Expedia, I noticed Firefox takes significantly more time to retrieve resources from the cache than Chrome does.

Firefox Nightly takes about 200-300ms on my machine to get most of the resources. Interestingly a local build of Firefox takes less (~150ms) and is more main thread bound.

Chrome's data is more interesting. When loading from the disk cache (i.e. when navigating away from Expedia and going back to a hotel page), it takes about 50-100ms. When navigating within a domain, it gets its stuff from the memory cache and it takes less than 10 ms.

Another interesting factor here that affects this is that Firefox pretty indiscriminately spews out a very large number of request on pageload, their, mainthread intensive, initialization workloads all get scheduled on the main thread, and block the first of the requests actually returning. This means that the speed at which, for example the first script on a page, is returned, actually depends on the total number of resources found on the page initially.

This is a profile from a nightly build, RCWN is disabled since it's kind of meaningless in this case:

https://share.firefox.dev/3Y61A6F

Here's an ETW profile from a Nightly build, this shows high overhead on the Cache2 thread from some CreateFile code:

https://share.firefox.dev/409oU6e

Here's an ETW profile from a local build, this particular overhead seems to not be present, things are faster and most of the work is on the main thread:

https://share.firefox.dev/3BXcYdn

And here's a Firefox profile of a local build where the Cache2 I/O thread is being profiled:

https://share.firefox.dev/4dNoLZ7

Thanks Bas.
Randell, how should we take take this forward?

Severity: -- → S3
Points: --- → 8
Rank: 1
Flags: needinfo?(rjesup)
Priority: -- → P2
Whiteboard: [necko-triaged][necko-priotity-review]

I'm making this part of the general cache investigation underway. It's not just the cache, it appears to be contention and CPU use on MainThread as well

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