Flash NPP_Destroy takes ~90ms. Impeding shutdown, navigation.

RESOLVED INCOMPLETE

Status

()

Core
Plug-ins
RESOLVED INCOMPLETE
5 years ago
5 months ago

People

(Reporter: BenWa, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Snappy:P1], URL)

(Reporter)

Description

5 years ago
Startup report:
https://people.mozilla.com/~bgirard/startup_report/report.html#PluginInstanceParent::Destroy

This currently list 10 shutdown profiles sorted from longest to shortest time spent in PluginInstanceParent::Destroy recorded on my system. Click on the profile will preview the profile + highlight the function.

Filing this bug even if I'm not sure if there's a ton we can do without a NPAPI change. Any ideas Benjamin?

Comment 1

5 years ago
We could TerminateProcess the plugin-container. I don't know whether that would totally destroy Flash data structures. Other than that, don't expect magic bullets.
(Reporter)

Comment 2

5 years ago
TerminateProcess? Do you just mean kill the plugin process?

Would it be possible to shutdown the plugin process async and have any other NPAPI call fail?
(Reporter)

Updated

5 years ago
Blocks: 810156

Comment 3

5 years ago
Yes, I mean killing the plugin process. It would be very difficult to asynchronously shut down the plugin process because it almost certainly continues to make calls into the browser as part of shutdown, and those would all need to be stubbed out with some kind of error message (and those error might cause additional instability). I think that if we're going to experiement with this, terminating the process is the better choice.

We could ask Adobe whether we they provide a new "shutting down now" API which would immediately save persistent state and then allow us to terminate the process more safely...
Plugin shutdown time measures https://bugzilla.mozilla.org/show_bug.cgi?id=706647
(Reporter)

Comment 5

5 years ago
Note that this measurement is very different then what my profile is measuring. It appears that we spend a lot of time destroying plugin instances on shutdown not the plugin process.
(Reporter)

Comment 6

5 years ago
I did more research on this. I can reproduce this on a fast windows machine as well as on mac. I confirmed that the slow down was coming from NPP_Destroy. Skipping that call makes the problem go away but will leak resources and will not let the plugin persist data. Leaking resource is okay on an optimized shutdown but we still need to persist data. This problem is particularly bad on shutdown because it scaled linearly with the number of open tab. i.e. 10 youtube tabs means you've added 1 second to your shutdown time.
OS: Mac OS X → All
Hardware: x86 → All
Summary: [Shutdown] Plug-in shutdown takes ~90ms on shutdown → Flash NPP_Destroy takes ~90ms. Impeding shutdown, navigation.
(Reporter)

Updated

5 years ago
No longer blocks: 810156
(Reporter)

Updated

5 years ago
Blocks: 819063
Whiteboard: [Snappy:P1]

Comment 7

5 months ago
Resolving old bugs which are likely not relevant any more, since NPAPI plugins are deprecated.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.