Closed
Bug 106153
Opened 23 years ago
Closed 23 years ago
XBL footprint: don't build XML elements for XBL
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
VERIFIED
FIXED
mozilla0.9.7
People
(Reporter: cathleennscp, Assigned: hyatt)
References
Details
Attachments
(1 file, 7 obsolete files)
9.52 KB,
patch
|
jag+mozilla
:
review+
hyatt
:
superreview+
|
Details | Diff | Splinter Review |
Summary: throw away XML elements in XBL → XBL footprint: throw away XML elements in XBL
Assignee | ||
Comment 1•23 years ago
|
||
Ok, I'm well along on this bug, and have a content sink up and limping.
Status: NEW → ASSIGNED
Summary: XBL footprint: throw away XML elements in XBL → XBL footprint: don't build XML elements for XBL
Assignee | ||
Comment 2•23 years ago
|
||
Adding harish to cc, since this involves making a new content sink that derives
from nsXMLContentSink.
Comment 3•23 years ago
|
||
Hyatt, FYI, my removal of mNameSpace from nsXMLElement and nsXULElement slots
has landed...
Assignee | ||
Comment 4•23 years ago
|
||
Comment 5•23 years ago
|
||
- Why do you even need to create an nsXMLDocument object at all? Can't
you just create an nsXBLContentSink and hook that directly up
to a parser, document be damned? RDF does this, e.g.
- Don't screw up the tabs in Makefile.in's (they have hard tabs).
- Don't need to use .get() to compare comptr's to raw ptrs anymore
- Did you want to leave this in? If so, use #if 0 (and explain why you're
doing it) instead of /**/ comments.
if (!hasExtends)
protoBinding->SetHasBasePrototype(PR_FALSE);
else {
+ /*// Nuke the display attribute off the content node to reduce our
+ // in-memory footprint.
+ if (hasDisplay)
+ child->UnsetAttr(kNameSpaceID_None, nsXBLAtoms::display, PR_FALSE);
+*/
+
+ // Now slice 'em up to see what we've got.
- I'm not seeing the implementation for nsXBLAtoms. Did you forget to cvs add
a file?
I'll need to look at the other stuff more carefully.
Assignee | ||
Comment 6•23 years ago
|
||
This is an incremental change, and I still rely on the document for other
unconverted pieces of XBL (this patch only converts <handlers>). Removing the
nsXMLDocument will be extremely involved (and should probably be covered in a
completely separate bug), but you are right that it will be possible to do so.
I just can't do it yet. :)
Assignee | ||
Updated•23 years ago
|
Attachment #56150 -
Attachment is obsolete: true
Assignee | ||
Comment 7•23 years ago
|
||
Comment 8•23 years ago
|
||
Comment on attachment 56174 [details] [diff] [review]
Patch with waterson's suggestions incorporated.
r=bryner
Attachment #56174 -
Flags: review+
Assignee | ||
Comment 9•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56174 -
Attachment is obsolete: true
Comment 10•23 years ago
|
||
sr=waterson
Comment 11•23 years ago
|
||
Do we really want a namespace ID (i.e. a PRInt32) in nsXBLAtoms? Seems silly to
me, why not just #define it in nsINameSpaceManager like we do for all other well
known namespaces? It's not like XBL won't always be there any more, and if it's
not we're talking very little code to predefine the namespace.
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Updated•23 years ago
|
Attachment #56186 -
Attachment is obsolete: true
Assignee | ||
Comment 12•23 years ago
|
||
Comment 13•23 years ago
|
||
Comment on attachment 57350 [details] [diff] [review]
Patch that reduces the footprint of <resources> (no more content model).
Add a license header to nsXBLPrototypeResources.cpp, add a out of memory check
to
nsXBLResourceLoader::StyleSheetLoaded() and
nsXBLResourceLoader::AddResourceListener()
sr=jst
Attachment #57350 -
Flags: superreview+
Comment 14•23 years ago
|
||
Looks good. Tested that it compiles fine on Linux.
You should also fix the license blocks in nsXBLResourceLoader.h and
nsXBLPrototypeResources.h to say 2001 instead of 1998 (and preferably use MPL
instead of NPL).
Comment 15•23 years ago
|
||
Comment on attachment 57350 [details] [diff] [review]
Patch that reduces the footprint of <resources> (no more content model).
r=bryner
Attachment #57350 -
Flags: review+
Assignee | ||
Updated•23 years ago
|
Attachment #57350 -
Attachment is obsolete: true
Assignee | ||
Comment 16•23 years ago
|
||
Ok, <resources> patch has landed. That just leaves the big one:
<implementation/>. My big fat baby's diet continues!
Assignee | ||
Comment 17•23 years ago
|
||
Assignee | ||
Comment 18•23 years ago
|
||
Comment 19•23 years ago
|
||
Comment on attachment 57456 [details] [diff] [review]
Required patch to XBL files to convert misuses of <property> to <field>.
sr=hewitt
Attachment #57456 -
Flags: superreview+
Assignee | ||
Comment 20•23 years ago
|
||
Comment on attachment 57456 [details] [diff] [review]
Required patch to XBL files to convert misuses of <property> to <field>.
Hixie reviewed. This patch has landed.
Attachment #57456 -
Attachment is obsolete: true
Attachment #57456 -
Flags: review+
Assignee | ||
Comment 21•23 years ago
|
||
Now seeking r/sr for the C++ patch, the only non-obsolete patch in the list!
Maybe you should make removeJSGCRoot and AddJSGCRoot non-static, since they're
already used in a bunch of files already? Putting static functions in a .h file
seems rather evil.
Assignee | ||
Comment 23•23 years ago
|
||
Fixed. I just moved the code into the method/property .cpp files.
Assignee | ||
Updated•23 years ago
|
Attachment #57455 -
Attachment is obsolete: true
Assignee | ||
Comment 24•23 years ago
|
||
Comment 25•23 years ago
|
||
Comment on attachment 57520 [details] [diff] [review]
<implementation> patch, with even more footprint reduction.
r=bryner. don't forget to remove the #includes of nsIXBLPrototypeProperty.h in
nsXBLBinding.cpp and nsXBLPrototypeBinding.h.
Attachment #57520 -
Flags: review+
Comment 26•23 years ago
|
||
Comment on attachment 57520 [details] [diff] [review]
<implementation> patch, with even more footprint reduction.
sr=ben@netscape.com
Attachment #57520 -
Flags: superreview+
Assignee | ||
Comment 27•23 years ago
|
||
Hallelujah, this bug is now fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
For running the bloat URLs in the page cycler, based on my new leak stats
tinderbox (not all that chrome-intensive):
before:
Leaks: 865355 bytes, 3911 allocations
Maximum Heap Size: 8654380 bytes
65024885 bytes were allocated in 422381 allocation
after:
Leaks: 864333 bytes, 3873 allocations
Maximum Heap Size: 8369059 bytes
67428214 bytes were allocated in 520298 allocations.
That's a 285K decrease in heap size!
Any idea what caused the increased churn in small allocations?
Assignee | ||
Comment 30•23 years ago
|
||
There is some string fu I've never seen before that I want to learn about.
mHandlerText = ToNewUnicode(nsDependentString(temp) + aText);
So the A + B string is a string that doesn't really make a new buffer to hold
A+B, but instead keeps the buffers separate and just lets you iterate over them
as though they are one string? If so, cool! I didn't know that existed. What
is the name of the string class that is made when you do A+B?
Second question. What the heck is this?
const nsASingleFragmentString& text
Hoping to get a bit of string education, so I can write more clever code in the
future... :)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•23 years ago
|
Attachment #57520 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 31•23 years ago
|
||
Ok, jag explained this all to me.
sr=hyatt. Removing AddLeaf and doing everything in FlushText is an awesome
simplification.
Assignee | ||
Updated•23 years ago
|
Attachment #57572 -
Flags: superreview+
Comment 32•23 years ago
|
||
Comment on attachment 57572 [details] [diff] [review]
patch that ought to reduce the number of allocations
r=jag
Attachment #57572 -
Flags: review+
Actually, in hindsight, I probably don't want to clobber CDATA sections that
aggressively -- I should fall through to the XML content sink for CDATA in the
same conditions as we fall through for FlushText.
In other words, I changed AddCDATASection to be:
NS_IMETHODIMP
nsXBLContentSink::AddCDATASection(const nsIParserNode& aNode)
{
if (mState == eXBL_InHandlers || mState == eXBL_InImplementation)
return AddText(aNode.GetText());
return nsXMLContentSink::AddCDATASection(aNode);
}
Assignee | ||
Comment 35•23 years ago
|
||
Looks good.
Unfortunately, that patch doesn't seem to fix the allocations problem.
Assignee | ||
Comment 37•23 years ago
|
||
String stuff moved to different bug. Closing this one out.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 38•23 years ago
|
||
To what bug number has it moved?
Actually bug 109963 is pretty much unrelated. If the problem doesn't go away
when I check in the patch above (which is good even if it doesn't fix the
problem), then I'll file an additional bug. It could be that the tinderbox I
was looking at does something that I wasn't doing when I tried to test to see if
it helps.
I think the allocation churn was noise on the tinderbox, since I saw the same
exact *increase* when I checked in the patches. :-)
You need to log in
before you can comment on or make changes to this bug.
Description
•