Closed
Bug 1374089
Opened 4 years ago
Closed 4 years ago
LayerTransactionParent does unnecessary hashtable lookups
Categories
(Core :: Graphics: Layers, enhancement, P2)
Core
Graphics: Layers
Tracking
()
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: mats, Assigned: mats)
References
Details
(Keywords: perf)
Attachments
(2 files)
|
2.06 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
|
3.03 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•4 years ago
|
||
Attachment #8878912 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 2•4 years ago
|
||
I think it's a bit silly to use nsDataHashtable with a RefPtr<> when we have a dedicated nsRefPtrHashtable class for that use case. Also, this avoid unnecessary ref counting in AsLayer().
Attachment #8878913 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 3•4 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6fdeee5d5a146334132009f42b0e7a1697cecb02
| Assignee | ||
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Comment on attachment 8878912 [details] [diff] [review] part 1 - Use LookupForAdd instead of Contains+Put, and remove an unnecessary Contains call before GetAndRemove, to avoid unnecessary hashtable lookups Review of attachment 8878912 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/ipc/LayerTransactionParent.cpp @@ +1028,2 @@ > } > + return IPC_FAIL_NO_REASON(this); Maybe write this as: if (!aHandle) { return IPC_FAIL_NO_REASON(this); } Maybe<RefPtr<Layer>> maybeLayer = ... if (!maybeLayer) { return IPC_FAIL_NO_REASON(this); } ... I know it duplicates the IPC_FAIL_NO_REASON bits, but I think this new version is more consistent with Gecko's general fail-fast/less-nesting-preferred coding style.
Attachment #8878912 -
Flags: review?(nfroyd) → review+
Comment 5•4 years ago
|
||
Comment on attachment 8878913 [details] [diff] [review] part 2 - Use nsRefPtrHashtable instead of nsDataHashtable with a RefPtr<> data type, since it's clearer and avoids unnecessary AddRef/Release calls Review of attachment 8878913 [details] [diff] [review]: ----------------------------------------------------------------- Yay for less refcounting!
Attachment #8878913 -
Flags: review?(nfroyd) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/80e602014cf2 part 1 - Use LookupForAdd instead of Contains+Put, and remove an unnecessary Contains call before GetAndRemove, to avoid unnecessary hashtable lookups. r=froydnj https://hg.mozilla.org/integration/mozilla-inbound/rev/5d4bb1715f7c part 2 - Use nsRefPtrHashtable instead of nsDataHashtable with a RefPtr<> data type, since it's clearer and avoids unnecessary AddRef/Release calls. r=froydnj
Comment 7•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/80e602014cf2 https://hg.mozilla.org/mozilla-central/rev/5d4bb1715f7c
Status: NEW → RESOLVED
Closed: 4 years 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.
Description
•