Closed
Bug 1355787
Opened 8 years ago
Closed 8 years ago
nsIdentifierMapEntry should let one to use either strings or atoms as keys
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(3 files)
Right now when binding, the already atomized id attribute is stringified and then
assigned to internal string member variable. NodeInfos has the setup where both nsIAtoms and strings can be used, and I think that would help here to reduce the overhead of converting to string.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bugs
Assignee | ||
Comment 1•8 years ago
|
||
The patch for this bug + the patch for bug 1217436 will cut 20% of the testcase.
Assignee | ||
Comment 2•8 years ago
|
||
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8857688 [details] [diff] [review]
atom_string_idtable.diff
This is on top of bug 1217436.
-m "Bug 1355787, nsIdentifierMapEntry should let one to use either strings or atoms as keys to avoid slow string assignments when possible. r=nfroyd"
Attachment #8857688 -
Flags: review?(nfroyd)
Comment 5•8 years ago
|
||
Comment on attachment 8857688 [details] [diff] [review]
atom_string_idtable.diff
Review of attachment 8857688 [details] [diff] [review]:
-----------------------------------------------------------------
r=me
::: dom/base/nsDocument.h
@@ +147,3 @@
> {
> public:
> + struct AtomOrString
In an ideal world, I think this would just be:
using AtomOrString = mozilla::Variant<nsCOMPtr<nsIAtom>, nsString>;
but maybe you like to be explicit here. :)
@@ +181,4 @@
> {
> }
> nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther) :
> + mKey(mozilla::Move(aOther.GetKey())),
mozilla::Move in a patch from smaug?! What is the world coming to?! ;)
Attachment #8857688 -
Flags: review?(nfroyd) → review+
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0a73f87d5741
nsIdentifierMapEntry should let one to use either strings or atoms as keys to avoid slow string assignments when possible. r=nfroyd
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•