Asynchronous Plugin Initialization improves plugin startup in Firefox - gHacks Tech News

Asynchronous Plugin Initialization improves plugin startup in Firefox

When you check out telemetry data that Mozilla collects about hangs in its Firefox web browser, you will notice that plugin-related issues are overrepresented there.

Plugins in this context refers exclusively to NPAPI plugins that the Firefox web browser supports such as Adobe Flash, Silverlight or Unity.

Whenever a Firefox user visits a web page that runs code that requires plugins, they need to be initialized.

Aaron Klotz broke the steps down on his blog post back in June 2014:

  1. Launch of plugin-container process.
  2. Calling the function NP_Initialize to load the plugin.
  3. Calling the function NPP_New to create instances.
  4. Calling the function NPP_NewStream for data loading instances.
  5. For scriptable instances, call NPP_GetValue.

The most frequent hang cause is the creation of the plugin-container process followed by the plugin startup process taking too long to go through the steps listed above.

Aaron worked on improvements for the process in 2014 by initializing plugins asynchronously. In particular, it will load the first four steps asynchronously to improve loading time and reduce the likelihood of hangs or slow downs caused by the initialization.

Check out the demo video below which shows an early prototype that Aaron created. It demonstrates the loading of a page using Flash with and without asynchronous plugin initialization.

As you can see in the demo, loading is faster and smoother with asynchronous plugin initialization enabled in the browser.

Mozilla launched the feature in Nightly yesterday. This means that Firefox Nightly users can use it right now, provided they have updated the version of the browser to the latest build.

firefox asynchronous plugins

It needs to be enabled before it can be used though:

  1. Type about:config in the address bar and hit enter.
  2. Confirm that you will be careful if a prompt is displayed.
  3. Search for dom.ipc.plugins.asyncInit using the search form at the top.
  4. Double-click the name that appears in search to set it to true.

This enables the feature and should improve plugin initialization in Firefox significantly. The feature is being tested currently and Mozilla asks users to file bugs if they notice issues while using Firefox with it enabled.

It is not clear yet when it will land in the stable version of the browser but I'd expect it to be released to it in the first half of 2015.

Firefox users who load sites that use plugins regularly in the browser should see noticeable improvements in loading time and a decrease in hangs or slow downs after activating the new feature.

Summary
Asynchronous Plugin Initialization improves plugin startup in Firefox
Article Name
Asynchronous Plugin Initialization improves plugin startup in Firefox
Description
Mozilla landed a new feature in Firefox Nightly that initializes plugins such as Adobe Flash asynchronously to improve loading speed and reduce hangs.
Author




  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. happysurf said on January 1, 2015 at 12:04 pm
      Reply

      Interesting info.
      Thanks.

    2. ThuGie ThuGz said on January 1, 2015 at 4:17 pm
      Reply

      Hey,

      Just tried it out for a bit, seems they are still working out some problems as expected.
      As quite a few flash related online games will get stuck loading.

      Works again when disabled, so i guess i will wait until i read a message about that being solved, or they enable it themselfs.
      Thanks for the great article though.

    3. DMV said on January 1, 2015 at 9:17 pm
      Reply

      Have a great 2015, Martin!! And thanks a lot for all your work!

    4. Dwight Stegall said on January 2, 2015 at 12:35 am
      Reply

      Sounds good to me. :)

    5. Doc said on January 3, 2015 at 5:37 am
      Reply

      “…process taking to long…” Too big, too small, too long, *two O’s.* :)

    6. vasiauvi said on January 3, 2015 at 11:07 am
      Reply

      Unfortunately, on Ubuntu PPA, Firefox Nightly is not yet released.

    Leave a Reply