Last Comment Bug 1336241 - Closing a window should be fast
: Closing a window should be fast
Status: NEW
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: 50 Branch
: Unspecified Unspecified
-- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Jim Mathies [:jimm]
Mentors:
Depends on: 1334635 1334642 1334655 1336763
Blocks: photon
  Show dependency treegraph
 
Reported: 2017-02-02 14:52 PST by Mike Conley (:mconley)
Modified: 2017-02-16 08:38 PST (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description User image Mike Conley (:mconley) 2017-02-02 14:52:57 PST
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.
Comment 1 User image :Harald Kirschner :digitarald 2017-02-02 14:59:29 PST
> 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?
Comment 2 User image Mike Conley (:mconley) 2017-02-02 15:04:08 PST
(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).
Comment 3 User image :Ehsan Akhgari 2017-02-02 15:14:21 PST
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.

Note You need to log in before you can comment on or make changes to this bug.