Closed Bug 1371952 Opened 7 years ago Closed 7 years ago

ProcessPriorityManager does unnecessary hashtable lookups

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: perf)

Attachments

(1 file)

      No description provided.
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+
I don't think it should matter, but I agree it's better to keep
the existing behavior exactly as you suggest.
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7c41eeb1420
Use LookupForAdd/LookupRemoveIf to avoid unnecessary hashtable lookups.  r=froydnj
https://hg.mozilla.org/mozilla-central/rev/f7c41eeb1420
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: