Closed
Bug 1372323
Opened 7 years ago
Closed 7 years ago
Console::IncreaseCounter does unnecessary hashtable lookups
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: perf)
Attachments
(1 file)
(deleted),
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
(This is another example where having a Remove method on EntryPtr
would save us a lookup. I think using LookupForAdd in these cases
is still preferable to Get+Put since the Remove is very rare.)
Attachment #8876860 -
Flags: review?(nfroyd)
Comment 3•7 years ago
|
||
Comment on attachment 8876860 [details] [diff] [review]
Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups
Review of attachment 8876860 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/console/Console.cpp
@@ +2195,5 @@
>
> aCountLabel = string;
>
> + const bool maxCountersReached = mCounterRegistry.Count() >= MAX_PAGE_COUNTERS;
> + auto entry = mCounterRegistry.LookupForAdd(aCountLabel);
Ew. I think this could be avoided by making EntryPtr a little more powerful, even beyond adding a Remove() method.
Attachment #8876860 -
Flags: review?(nfroyd) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eb36d574ec6e
Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj
Comment 5•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•