Closed
Bug 81746
Opened 24 years ago
Closed 24 years ago
EntityNode is bloaty
Categories
(Core :: DOM: HTML Parser, defect, P3)
Core
DOM: HTML Parser
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(1 file)
4.24 KB,
patch
|
Details | Diff | Splinter Review |
EntityNode (in htmlparser/src/nsHTMLEntity.cpp) is currently 92 bytes each - 4
bytes for the unicode codepoint and 4 bytes for the nsCAutoString. This can be
reduced to 8 bytes since the strings are already stored in the text segment of
the program so there's no need to copy them into nsCAutoStrings. The patch
reduces copying both at the time of construction of the table and at the time of
comparison, although there are further performance improvements that could be
made if we need to.
Patch coming. I still need to figure out how to test the caller of
UnicodeToEntity. EntityToUnicode clearly works since pages with character
entities display fine.
Harish, could you review?
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.2
Assignee | ||
Comment 2•24 years ago
|
||
I just changed the comment in nsHTMLEntities.h to reflect the change:
- * returns an empty string if the entity cannot be mapped.
+ * returns null if the entity cannot be mapped.
Assignee | ||
Comment 3•24 years ago
|
||
s/already stored in the text segment of the program/already stored in the text
segment of the program or, for short-lived EntityNode objects, provided by the
creator/
Comment 6•24 years ago
|
||
+static const char* gEntityNames[] = {
Last I read, there's a preference that this be const char* const, no?
Other than that, sr=vidur.
Assignee | ||
Comment 7•24 years ago
|
||
OK, added the const to gEntityNames ("const char* const") and the parallel const
("const PRInt32") for the gEntityCodes array.
And, FWIW, I tested the conversion the other way using the editor (by typing in
the characters וילר� and making sure the entities came out the right way),
which, from looking at the code, seems to be the only user of the reverse
conversion.
Comment 8•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Assignee | ||
Comment 9•24 years ago
|
||
Fix checked in 2001-06-04 17:39 PDT.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 10•24 years ago
|
||
Marking verified as per above developer comments.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•