Open
Bug 499641
Opened 16 years ago
Updated 3 years ago
[HTML5] Avoid hitting new/delete for attribute holder's arrays
Categories
(Core :: DOM: HTML Parser, enhancement, P4)
Tracking
()
NEW
People
(Reporter: hsivonen, Unassigned)
Details
The attribute holder object in the HTML5 parser allocates an array for attribute names and another for attribute values from the heap. This is OK when there's only one holder per parser.
Speculative parsing will likely require a new attribute holder to be allocated per start tag token so that the holders can be put into the tree operation queue and travel across the thread boundary for deferred element node creation and attribute setting.
In that scenario, it would be desirable to avoid hitting malloc thrice when an attribute holder is allocated. Instead of allocating the arrays from the heap, the attribute holder object itself should have space for arrays of 5 slots. (Tags with more than 5 attributes are quite rare according to Hixie's study of the Google index.)
If an attribute holder gets more than 5 attributes, only then should the arrays be allocated from the heap. (In which case the space within the object would be wasted.)
| Reporter | ||
Updated•15 years ago
|
Priority: -- → P4
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•