Closed Bug 898192 Opened 11 years ago Closed 11 years ago

Social API does unnecessary work in onLocationChange when it's disabled

Categories

(Firefox Graveyard :: SocialAPI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 25

People

(Reporter: MattN, Assigned: MattN)

Details

(Keywords: perf, Whiteboard: [qa-])

Attachments

(1 file)

onLocationChange calls the following functions even when SocialAPI is disabled:
          SocialMark.updateMarkState();
          SocialShare.update();

These functions do more work than necessary for this hot code path.

Try push: https://tbpl.mozilla.org/?tree=Try&rev=414a9b7337bb
Comment on attachment 781298 [details] [diff] [review]
wip.1 Skip social function calls when !SocialUI.enabled

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

that looks right to me!
Attachment #781298 - Flags: feedback+
Comment on attachment 781298 [details] [diff] [review]
wip.1 Skip social function calls when !SocialUI.enabled

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

This looks good to me, anything else needed here? Only thing that I wonder is if we can make Social.enabled faster so it can cache the state until something makes it dirty.
Attachment #781298 - Flags: review+
(In reply to Jared Wein [:jaws] from comment #2)
> Only thing that I wonder
> is if we can make Social.enabled faster so it can cache the state until
> something makes it dirty.

I take this back. Social.enabled only checks the Social._provider private variable. Somehow I had thought that this in turn checked all of the providers to see if any of them were enabled, but I was wrong.

So this looks good to land from my POV as long as all tests pass.
This made it to central - https://hg.mozilla.org/mozilla-central/rev/91c8657b0fa9
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
Matt, is there anything QA needs to do to verify this is fixed?
Flags: needinfo?(mnoorenberghe+bmo)
Verification for this shouldn't be necessary and it would be hard to verify anyways.
Flags: needinfo?(mnoorenberghe+bmo)
(In reply to Jared Wein [:jaws] from comment #7)
> Verification for this shouldn't be necessary and it would be hard to verify
> anyways.

Thanks Jared.
Whiteboard: [qa-]
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: