Bug 75071 - Reduce per-attribute overhead by no longer heap-allocating Attribute objects
Summary: Reduce per-attribute overhead by no longer heap-allocating Attribute objects
Status: RESOLVED DUPLICATE of bug 83440
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-21 23:41 PST by Darin Adler
Modified: 2019-02-06 09:03 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2011-12-21 23:41:35 PST
It seems that we do not need to heap-allocate Attribute objects. Reference counting each one seems like overkill. There must be a way to have the Vector of attributes contain the attributes themselves rather than just heap pointers. These are not variable-size objects.
Comment 1 Ryosuke Niwa 2011-12-21 23:44:34 PST
But Attribute objects are exposed to JavaScript and can be removed from / added back to NamedNodeMap. How are we going to do that if they were a part of NamedNodeMap?
Comment 2 Darin Adler 2011-12-21 23:46:19 PST
(In reply to comment #1)
> But Attribute objects are exposed to JavaScript and can be removed from / added back to NamedNodeMap. How are we going to do that if they were a part of NamedNodeMap?

Attr objects are exposed to JavaScript. Attribute objects are internal to WebKit and not exposed to JavaScript.
Comment 3 Darin Adler 2011-12-21 23:47:18 PST
(In reply to comment #2)
> (In reply to comment #1)
> > But Attribute objects are exposed to JavaScript and can be removed from / added back to NamedNodeMap. How are we going to do that if they were a part of NamedNodeMap?
> 
> Attr objects are exposed to JavaScript. Attribute objects are internal to WebKit and not exposed to JavaScript.

Supporting Attr may still pose some challenges, but I am pretty sure that we don’t need to start doing all that heap allocating until people actually use Attr.
Comment 4 Ryosuke Niwa 2012-07-23 00:14:33 PDT
This has been done in http://trac.webkit.org/changeset/114870 by anttik.
Comment 5 Antti Koivisto 2012-07-23 07:32:34 PDT
By kling!

*** This bug has been marked as a duplicate of bug 83440 ***
Comment 6 Lucas Forschler 2019-02-06 09:03:18 PST
Mass moving XML DOM bugs to the "DOM" Component.