Closed Bug 1217436 Opened 9 years ago Closed 7 years ago

Make nsIdentifierMapEntry::mIdContentList a nsAutoTArray to save an allocation

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox44 --- affected
firefox55 --- fixed

People

(Reporter: poiru, Assigned: smaug)

References

Details

Attachments

(2 files)

See bug 819090 comment 32 and onwards.
Assignee: birunthan → bugs
Blocks: 1355472
Using non-moveable PLDHashEntryHdr is not good at all for the performance, but seems like in common
cases the allocation is even slower.
We do need to get SmallVoidArray back in some form, but that shouldn't block this bug.
Attachment #8857686 - Flags: review?(nfroyd)
Commit message could be
-m "Bug 1217436 - Make nsIdentifierMapEntry::mIdContentList an AutoTArray to save an allocation, r=nfroyd"
I'm still wondering if 
Element* mFirstElement;
nsTArray<Element*> mIdContentList; 
should be used here to allow memmoves.
That should give better perf but possible make the code quite a bit more complicated.
But that is for another bug.
Comment on attachment 8857686 [details] [diff] [review]
id_hash_autoarray.diff

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

::: dom/base/nsDocument.h
@@ +156,5 @@
>    explicit nsIdentifierMapEntry(const nsAString* aKey) :
>      nsStringHashKey(aKey), mNameContentList(nullptr)
>    {
>    }
> +  nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther) :

Is it possible to delete the copy constructor (and maybe copy assignment, too) here just to make sure, or does that run into weird compile errors somewhere?
Attachment #8857686 - Flags: review?(nfroyd) → review+
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0bd3edbb660b
Make nsIdentifierMapEntry::mIdContentList an AutoTArray to save an allocation, r=nfroyd
https://hg.mozilla.org/mozilla-central/rev/0bd3edbb660b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: