Closed
Bug 62898
Opened 24 years ago
Closed 23 years ago
Content elements contain large amount of code which simply redirect to a mInner object
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: kmcclusk, Assigned: jst)
Details
(Keywords: dom0, memory-footprint)
Running PureCoverage on viewer over 60 of the top100 sites I noticed that
layout\html\content\src and layout\base\src contain a large number of DOM methods
which are simply redirects to a mInner object. The redirects are implemented
using Macros. Even though these methods are only a single line long they add up
to be a significant amount of code. In general, the non-accessed DOM methods in
the content objects contribute over 300K of non-accessed code to a 1.8 meg WIN32
release build. I'm not sure how much is generated by re-directed code but
clicking on methods in PureCoverage I noticed that a fairly large number of them
were implemented using the DOM Macro's.
Is there an easy way to eliminate the mInner object using derivation instead of
delegation which would save code space in the layout dll?
There is a report at this URL which shows the directories which had the most
lines of code missed during the PureCoverage run:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=20192
Assignee | ||
Comment 2•24 years ago
|
||
This is unfortunate, but given the way the DOM interfaces are structured there
is not really much we can easily do about this wrt the DOM interfaces. We're
currently also doing the same forwarding for nsIHTMLContent (and
nsIStyledContent and nsIContent) methods but I have restructured the whole
content model implementation in my tree that gets rid of all the methods that
forward nsIContent methods to the inner object. Also, the inner object no longer
exist in my tree, in stead there's a cleaner inheritance model used between the
leaf HTML classes and their base classes. Getting rid of the nsIContent methods
from the HTML content model saves us about 30 or so methods in about 60 classes
--> 1800 fewer methods. But to my knowledge there's no easy way to achieve the
same thing with the DOM interfaces...
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•24 years ago
|
||
I landed my changes that got rid of a large number of the forwarding methods
from the content model code and AFAIK that's all we can do about this for now,
maybe we'll come up with a better idea later on. Marking Future for now.
Target Milestone: --- → Future
Comment 4•23 years ago
|
||
I don't think there's anything mInner-related left in content elements code. LXR
found mInner-related stuff in Style System, exceptions, RDF, nodeInfo, and XBL,
but not in content elements anymore.
Assignee | ||
Comment 5•23 years ago
|
||
True, mInner is no more.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•