Last Comment Bug 881575 - Avoid triggering plugin list initialization on startup
: Avoid triggering plugin list initialization on startup
Status: RESOLVED FIXED
[pdfjs-c-integration]
:
Product: Firefox
Classification: Client Software
Component: PDF Viewer (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Vladan Djeric (:vladan)
:
Mentors:
: 880300 (view as bug list)
Depends on: 888635
Blocks: start-faster
  Show dependency treegraph
 
Reported: 2013-06-10 18:23 PDT by Vladan Djeric (:vladan)
Modified: 2013-07-04 11:51 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Change order of pdf plugin checks (2.28 KB, patch)
2013-06-10 18:25 PDT, Vladan Djeric (:vladan)
bdahl: review+
Details | Diff | Review

Description Vladan Djeric (:vladan) 2013-06-10 18:23:25 PDT
Pdf.js requests the list of enabled plugins during its initialization which  causes nsPluginHost to stat plugin directories & plugin libraries. This is main-thread I/O which delays startup by roughly 100 ms in my setup.

This patch changes the pdf.js initialization logic to first check if pdf handling by plugins is disabled in prefs before requesting the list of enabled plugins. Pdf.js already disables the pdf plugin via prefs during Firefox migration, so we'll practically never need to consult the list of enabled plugins.
Comment 1 Vladan Djeric (:vladan) 2013-06-10 18:25:40 PDT
Created attachment 760678 [details] [diff] [review]
Change order of pdf plugin checks
Comment 2 Vladan Djeric (:vladan) 2013-06-10 18:35:18 PDT
https://tbpl.mozilla.org/?tree=Try&rev=2af459dbc000
Comment 3 Vladan Djeric (:vladan) 2013-06-10 19:49:34 PDT
*** Bug 880300 has been marked as a duplicate of this bug. ***
Comment 4 Jared Wein [:jaws] (please needinfo? me) 2013-06-10 20:37:06 PDT
Comment on attachment 760678 [details] [diff] [review]
Change order of pdf plugin checks

Review of attachment 760678 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/extensions/pdfjs/content/PdfJs.jsm
@@ +204,5 @@
>      }
>  
> +    // Check if have disabled plugin handling of 'application/pdf' in prefs
> +    if (Services.prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES)) {
> +      var disabledPluginTypes =

s/var/let/
Comment 5 Brendan Dahl [:bdahl] 2013-06-14 08:37:01 PDT
Comment on attachment 760678 [details] [diff] [review]
Change order of pdf plugin checks

Review of attachment 760678 [details] [diff] [review]:
-----------------------------------------------------------------

If you're comfortable with github it'd be best to do a pull request against https://github.com/mozilla/pdf.js/blob/master/extensions/firefox/content/PdfJs.jsm . If not I can land the changes upstream in pdf.js.
Comment 6 Vladan Djeric (:vladan) 2013-06-14 16:11:39 PDT
I submitted the pull request: https://github.com/mozilla/pdf.js/pull/3366

I don't need to land on mozilla-inbound, right?
Comment 7 Ed Morley [:emorley] 2013-06-25 00:33:16 PDT
(In reply to Vladan Djeric (:vladan) from comment #6)
> I submitted the pull request: https://github.com/mozilla/pdf.js/pull/3366
> 
> I don't need to land on mozilla-inbound, right?

No - there are periodic pulls of the latest pdf.js into mozilla-inbound :-)
Comment 8 Vladan Djeric (:vladan) 2013-07-04 11:51:48 PDT
This was merged with bug 888635. It looks like there was a 2-3% Talos startup improvement on Ubuntu & Mac :)


Improvement: Mozilla-Inbound-Non-PGO - Ts, Paint - Ubuntu HW 12.04 - 2.93% decrease
-----------------------------------------------------------------------------------
    Previous: avg 693.789 stddev 3.600 of 12 runs up to revision 87b5a0591aff
    New     : avg 673.456 stddev 6.887 of 12 runs since revision b4b9098538cb
    Change  : -20.333 (2.93% / z=5.648)
    Graph   : http://mzl.la/12AlyVJ

Changeset range: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=87b5a0591aff&tochange=b4b9098538cb

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