[meta] Closing a window should be fast

NEW
Unassigned

Status

()

Core
General
6 months ago
3 months ago

People

(Reporter: mconley, Unassigned)

Tracking

(Depends on: 2 bugs, Blocks: 1 bug, {meta})

50 Branch
Points:
---
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [photon-performance])

As part of our efforts to improve perceived performance, one of the things that the UX team has identified coming out of the Photon work is that we want the act of closing windows to be very fast. As close to instantaneous as possible.

There's some stuff that goes on when we kick off a close of a window:
1) We ask each tab, "do you have an onbeforeunload handler?" since these might prevent the window from opening right away. This involves sending message(s) down to each tab, and waiting for responses to each. We currently wait a max of 5 seconds before giving up and killing the tab. This is probably where we could do a lot better.
2) We do some SessionStore work to (maybe) put the window state into the "restorable window" bucket

Finding a better solution to (1) would also make closing tabs faster.
> 1) We ask each tab, "do you have an onbeforeunload handler?" since these might prevent the window from opening right away. This involves sending message(s) down to each tab, and waiting for responses to each. We currently wait a max of 5 seconds before giving up and killing the tab. This is probably where we could do a lot better.

Do we have Telemetry for how fast most handlers respond?
Flags: needinfo?(mconley)
(In reply to :Harald Kirschner :digitarald from comment #1)
> > 1) We ask each tab, "do you have an onbeforeunload handler?" since these might prevent the window from opening right away. This involves sending message(s) down to each tab, and waiting for responses to each. We currently wait a max of 5 seconds before giving up and killing the tab. This is probably where we could do a lot better.
> 
> Do we have Telemetry for how fast most handlers respond?

No.

Note that this is mainly a question of "is the main thread in the content process for this tab blocked", because that's really what we're gated on (minus the IPC traffic overhead, which is minimal). Once the message is received by content, it returns an answer right away (which the parent will respond to immediately - if it doesn't, that means the main thread of the parent is blocked and you're sunk anyway).
Flags: needinfo?(mconley)
Depends on: 1334642
I was profiling window closing the other day.  We do a bunch of slow stuff, and I filed three bugs for them.  There is probably more to file and fix.
Depends on: 1334655, 1334635
Depends on: 1336763
Depends on: 1340842

Updated

5 months ago
Priority: -- → P3
Whiteboard: tpi:+
Depends on: 1344302
No longer depends on: 1336763, 1340842

Updated

4 months ago
Blocks: 1348289

Updated

4 months ago
No longer blocks: 1325171

Updated

4 months ago
Whiteboard: tpi:+ → [photon] tpi:+

Updated

4 months ago
Component: Widget: Win32 → General
Whiteboard: [photon] tpi:+ → [photon]

Updated

4 months ago
Flags: qe-verify-
Keywords: meta
Priority: P3 → --
Summary: Closing a window should be fast → [meta] Closing a window should be fast

Updated

4 months ago
Whiteboard: [photon] → [photon-performance]
Blocks: 1363777
No longer blocks: 1348289
Blocks: 1363767
No longer blocks: 1363777
You need to log in before you can comment on or make changes to this bug.