PREF_SSL_IMPACT is visible in startup profiles

RESOLVED FIXED in Firefox 57



2 years ago
2 years ago


(Reporter: florian, Assigned: prasanthmani2010, Mentored)


(Blocks 2 bugs, {good-first-bug})

Firefox 57
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox57 fixed)



(3 attachments)



2 years ago

The PREF_SSL_IMPACT array shouldn't be created before first paint. Either it should become a lazy getter, or it should be computed whenever it's used (which doesn't seem to be often). Also, I think precomputing the value may give incorrect results if preferences without default values are created in these branches between startup and when we actually use the array.

The profile shows it in browser.js ( but it's most likely slow at too.
Looks like a good first/mentored bug to me.
Mentor: jhofmann
Flags: qe-verify-
Keywords: good-first-bug

Comment 2

2 years ago
I am interested in working with this bug.
Great! As Florian mentioned, it is probably easiest to inline the variable in these two places:

instead of making it a global const.

You can verify that your patch doesn't break bug 1252068 by running

./mach mochitest browser/base/content/test/about/browser_aboutNetError.js

Let me know if you have any questions.

Assignee: nobody → prasanthmani2010

Comment 4

2 years ago
I made the changes as per your suggestion and have run the mochitest , It passed all the 3 cases. How to proceed further ?
Hey, that's cool! We need to get this uploaded for review now.

Since I know from IRC that you have a patch but are not able to use mozreview for unknown reasons (sorry for that), you could try manually attaching the patch to Bugzilla via the "Attach File" link on this page. You can set the review? flag on the patch to me (:johannh).

Let me know if that works.

Comment 7

2 years ago
Posted patch mypatch.patchSplinter Review
Attachment #8891723 - Flags: review?(jhofmann)
Comment on attachment 8891723 [details] [diff] [review]

Review of attachment 8891723 [details] [diff] [review]:

Thanks! This patch would probably have the effect we're looking for, but we can still improve it a bit.

::: browser/base/content/browser.js
@@ +2867,4 @@
>    },
>    receiveMessage(msg) {
> +    const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {

Please use

let prefSSLImpact = ...

or a similar name instead :)

@@ +2868,5 @@
>    receiveMessage(msg) {
> +    const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
> +      return prefs.concat(Services.prefs.getChildList(root));
> +    }, []);

It's probably not great for performance to build this every time receiveMessage is received (when any kind of message is received). We should only do it inside the switch .. case branch that needs it.

::: browser/base/content/content.js
@@ +371,4 @@
>    },
>    changedCertPrefs() {
> +    const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {

See above, please use let instead of const.
Attachment #8891723 - Flags: review?(jhofmann) → feedback+

Comment 9

2 years ago
have made the changes as per the discussion. kindly check if I have implemented them.
Attachment #8892767 - Flags: review?(jhofmann)
Comment on attachment 8892767 [details] [diff] [review]

Yay, these are the correct changes, but please amend your original patch. Both patches merged would get an r+ from me.

You can use something like hg histedit to combine your two patches and upload the unified patch here for a final round of review :)

Let me know if you need help with that. (I'm also available on IRC).
Attachment #8892767 - Flags: review?(jhofmann) → feedback+
I merged the two changesets with hg histedit (retaining your authorship information). Thanks!
Attachment #8898711 - Flags: review?(jhofmann)
Assignee: prasanthmani2010 → jhofmann
Assignee: jhofmann → prasanthmani2010
Attachment #8898711 - Flags: review?(jhofmann) → review+
I'll land this as soon as inbound opens...

Comment 13

2 years ago
Pushed by
PREF_SSL_IMPACT array declaration made into inline. r=johannh
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
You need to log in before you can comment on or make changes to this bug.