RESOLVED FIXED Bug 75069
Make elements with attributes smaller by eliminating the m_element back pointer in NamedNodeMap
https://bugs.webkit.org/show_bug.cgi?id=75069
Summary Make elements with attributes smaller by eliminating the m_element back point...
Darin Adler
Reported 2011-12-21 23:38:12 PST
The back pointer from the heap-allocated vector of attributes to the element is a waste of space. We should move the data from the current NamedNodeMap class into a new heap-allocated class that is independent of the DOM. The NamedNodeMap class should then just be a class with an Element* in it. The pointer to NamedNodeMap could go into ElementRareData or some other map, and all the operations could be done based on data stored in the element and its data structures. NamedNodeMap would no longer have any data of its own.
Attachments
Patch (32.34 KB, patch)
2012-03-07 20:00 PST, Caio Marcelo de Oliveira Filho
no flags
Patch (33.57 KB, patch)
2012-03-08 05:38 PST, Caio Marcelo de Oliveira Filho
no flags
Caio Marcelo de Oliveira Filho
Comment 1 2012-01-27 11:54:28 PST
I intend to implement this in steps. The first one is bug 77233 which would add ElementAttributeData, that will be the internal attribute storage. In that patch it is still part of NamedNodeMap, so no real change happen yet. It already contains the style related members that were in NamedNodeMap. The next step is moving m_attributes to the ElementAttributeData, and the last step would be moving ElementAttributeData to Element and moving NamedNodeMap inside ElementRareData.
Caio Marcelo de Oliveira Filho
Comment 2 2012-03-07 20:00:36 PST
Caio Marcelo de Oliveira Filho
Comment 3 2012-03-07 20:04:23 PST
It took more steps than planned because I made them smaller. In the end this made things easier to review. Tomorrow I'm planning to improve the ChangeLog with some empirical data of memory usage.
Ryosuke Niwa
Comment 4 2012-03-07 20:14:43 PST
Comment on attachment 130754 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130754&action=review > Source/WebCore/dom/Element.cpp:203 > +NamedNodeMap* Element::attributes() const I don't think this function should have const qualifier.
WebKit Review Bot
Comment 5 2012-03-07 21:34:15 PST
Comment on attachment 130754 [details] Patch Attachment 130754 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11861141
Caio Marcelo de Oliveira Filho
Comment 6 2012-03-08 05:38:35 PST
Caio Marcelo de Oliveira Filho
Comment 7 2012-03-08 05:41:37 PST
Comment on attachment 130754 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130754&action=review >> Source/WebCore/dom/Element.cpp:203 >> +NamedNodeMap* Element::attributes() const > > I don't think this function should have const qualifier. What about Node::attributes()?
Caio Marcelo de Oliveira Filho
Comment 8 2012-03-08 09:44:28 PST
Julien Chaffraix
Comment 9 2012-03-14 08:59:23 PDT
Comment on attachment 130810 [details] Patch Clearing review flag from an old attachment so that it doesn't show on the review queue.
Lucas Forschler
Comment 10 2019-02-06 09:03:27 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note You need to log in before you can comment on or make changes to this bug.