ProcessPriorityManager does unnecessary hashtable lookups

RESOLVED FIXED in Firefox 56

Status

()

Core
IPC
P3
normal
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: mats, Assigned: mats)

Tracking

({perf})

Trunk
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

2 months ago
Created attachment 8876425 [details] [diff] [review]
Use LookupForAdd/LookupRemoveIf to avoid unnecessary hashtable lookups
Attachment #8876425 - Flags: review?(nfroyd)
Comment on attachment 8876425 [details] [diff] [review]
Use LookupForAdd/LookupRemoveIf to avoid unnecessary hashtable lookups

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

r=me assuming you agree with the below.  If not, we should talk about it.

::: dom/ipc/ProcessPriorityManager.cpp
@@ +507,5 @@
> +    [] (RefPtr<ParticularProcessPriorityManager>& aValue) {
> +      aValue->ShutDown();
> +      return true; // remove it
> +    });
> +  mHighPriorityChildIDs.RemoveEntry(childID);

Shouldn't this really live inside the lambda in the LookupRemoveIf call as well?  I mean, it might not matter if it's done outside the lambda, but that would require a bit of examining to see whether that's safe, and putting it inside the lambda would definitely not change the behavior.
Comment on attachment 8876425 [details] [diff] [review]
Use LookupForAdd/LookupRemoveIf to avoid unnecessary hashtable lookups

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

Gah, flip flag.
Attachment #8876425 - Flags: review?(nfroyd) → review+
(Assignee)

Comment 4

2 months ago
I don't think it should matter, but I agree it's better to keep
the existing behavior exactly as you suggest.

Comment 5

2 months ago
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7c41eeb1420
Use LookupForAdd/LookupRemoveIf to avoid unnecessary hashtable lookups.  r=froydnj

Comment 6

2 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f7c41eeb1420
Status: NEW → RESOLVED
Last Resolved: 2 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.