Closed Bug 1554242 Opened 5 years ago Closed 5 years ago

Sending a blob to a content process does main thread I/O

Categories

(Core :: DOM: File, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla71
Performance Impact high
Tracking Status
firefox71 --- fixed

People

(Reporter: florian, Assigned: alexical)

Details

(Keywords: perf:pageload, Whiteboard: [fxperf:p2])

Attachments

(1 file)

See this profile: https://perfht.ml/2EuYXmJ

Some activity stream code is sending a PNG thumbnail as a blob to its privileged content process. This causes main thread I/O in the parent process: nsresult mozilla::dom::IPCBlobInputStream::Close calls nsFileInputStream::Close which indirectly calls nsFileStreamBase::DoOpen (through calling nsFileStreamBase::Tell)

Component: IPC → DOM: File
Whiteboard: [fxperf][qf] → [fxperf:p2][qf]

Marking this as p1:pageload since it may occur frequently during every new tab. Florian, could you please confirm whether this occurs on every new tab, or only the startup new tab page? If it's the latter, we'll probably end up marking it p2 instead.

Flags: needinfo?(florian)
Whiteboard: [fxperf:p2][qf] → [fxperf:p2][qf:p1:pageload]
Priority: -- → P3

(In reply to Denis Palmeiro [:denispal] from comment #1)

Marking this as p1:pageload since it may occur frequently during every new tab. Florian, could you please confirm whether this occurs on every new tab, or only the startup new tab page?

This profile of opening a few new tabs show the main thread I/O markers to the same .png images 3 times: https://perfht.ml/2ZvPg05
So yes, I confirm it happens every time about:newtab is loaded.

Flags: needinfo?(florian)

Taking a look at this to see if anything can be done.

Assignee: nobody → dothayer
Status: NEW → ASSIGNED

In bug 1554242 we're noticing main thread file IO sending a PNG
thumbnail as a blob over IPC. The stack is roughly
IPCBlobInputStream::Close() -> nsFileInputStream::Close() ->
nsFileStreamBase::DoOpen(). The file in question is always a
deferred open file, and we didn't open it in append mode, so there
is no way for ftell to be anything other than 0 (?). This was
verified with an assertion on a try run.

Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7261371d7f5e
Don't open file just to ftell it r=baku
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Performance Impact: --- → P1
Keywords: perf:pageload
Whiteboard: [fxperf:p2][qf:p1:pageload] → [fxperf:p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: