Closed Bug 199503 Opened 22 years ago Closed 21 years ago

[minimo]consolidate layout atoms

Categories

(Core :: Layout, defect, P2)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: alecf, Assigned: alecf)

References

Details

(Keywords: memory-footprint)

Attachments

(1 file, 1 obsolete file)

sprinkled all throughout layout is this pattern: - for a given class, keep a global refcount - in the constructor, increment the refcount. when that refcount first hits 1, create a few atoms that the class will use - in the destructor, decrement the refcount. when that refcount hits 0, destroy the atoms This is absurd! We have a decent mechanism to store static references to specific atoms, there is no need to do all this extra work. This was mentioned in bug 199170, but I've found enough to warrant a whole seperate bug. patch forthcoming.
Attached patch consolidate the atoms v1 (deleted) — Splinter Review
ok, here's the updated patch the only odd thing was that occasionally I'd find an atom I'd need (like "script" or "href") in nsHTMLAtoms, even though I was in the XML or XUL directories.. I figure the choices are: - just #include "nsHTMLAtoms.h" and use it directly - put a "duplicate" entry in nsXULAtoms or nsLayoutAtoms or something, and let the compiler consolidate the string values. - move it OUT of nsHTMLAtoms and into nsLayoutAtoms anyway I'd love dbaron/bryner to take a look, this looks like a cheap way to get some static footprint back..
Comment on attachment 118672 [details] [diff] [review] consolidate the atoms v1 can I get reviews here? seem my previous comment.. (I went with the first option)
Attachment #118672 - Flags: superreview?(bryner)
Attachment #118672 - Flags: review?(dbaron)
Comment on attachment 118672 [details] [diff] [review] consolidate the atoms v1 Looks good, assuming the extra atom creation doesn't measurably impact startup time.
Attachment #118672 - Flags: superreview?(bryner) → superreview+
Summary: consolidate layout atoms → [minimo]consolidate layout atoms
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.4beta
Attached patch convert nsDirectoryService over to static atoms (obsolete) (deleted) — Splinter Review
here are a bunch of atoms from xpcom.
Comment on attachment 119214 [details] [diff] [review] convert nsDirectoryService over to static atoms oops, wrong bug.
Attachment #119214 - Attachment is obsolete: true
Comment on attachment 118672 [details] [diff] [review] consolidate the atoms v1 r=jag
Attachment #118672 - Flags: review?(dbaron) → review+
libgklayout.so decreased by 4k+! libgklayout.so Total: -4416 (+59/-4475) Code: -3424 (+20/-3444) Data: -992 (+39/-1031) -64 (+0/-64) B (DATA) -64 (+0/-64) UNDEF:libgklayout.so:B -4 xmlns_len.4866 -4 kTypeAtom -4 kShowAtom -4 kHrefAtom -4 kEmbedAtom -4 kElementCount -4 kBaseAtom -4 kActuateAtom -4 XULSortServiceImpl::kStaticsSortLastHintAtom -4 XULSortServiceImpl::kStaticHintAtom -4 XULSortServiceImpl::kSortSeparatorsAtom -4 XULSortServiceImpl::kSortResourceAtom -4 XULSortServiceImpl::kSortResource2Atom -4 XULSortServiceImpl::kResourceAtom -4 XULSortServiceImpl::kRDF_type -4 XULContentSinkImpl::kScriptAtom -256 (+28/-284) D (DATA) -256 (+28/-284) UNDEF:libgklayout.so:D +28 nsXBLWindowHandler::sRefCnt -4 nsXBLXULHandler::kPopupShownAtom -4 nsXBLXULHandler::kPopupShowingAtom -4 nsXBLXULHandler::kPopupHidingAtom -4 nsXBLXULHandler::kPopupHiddenAtom -4 nsXBLXULHandler::kCommandUpdateAtom -4 nsXBLXULHandler::kCloseAtom -4 nsXBLXULHandler::kBroadcastAtom -4 nsXBLXULHandler::gRefCnt -4 nsXBLWindowKeyHandler::kKeyUpAtom -4 nsXBLWindowKeyHandler::kKeyPressAtom -4 nsXBLWindowKeyHandler::kKeyDownAtom -4 nsXBLWindowKeyHandler::gRefCnt -4 nsXBLWindowDragHandler::kDragOverAtom -4 nsXBLWindowDragHandler::kDragGestureAtom -4 nsXBLWindowDragHandler::kDragExitAtom -4 nsXBLWindowDragHandler::kDragEnterAtom -4 nsXBLWindowDragHandler::gRefCnt -4 nsXBLService::gDisableChromeCache -4 nsXBLScrollHandler::kUnderflowAtom -4 nsXBLScrollHandler::kOverflowChangedAtom -4 nsXBLScrollHandler::kOverflowAtom -4 nsXBLScrollHandler::gRefCnt -4 nsXBLMutationHandler::kSubtreeModifiedAtom -4 nsXBLMutationHandler::kNodeRemovedFromDocumentAtom -4 nsXBLMutationHandler::kNodeRemovedAtom -4 nsXBLMutationHandler::kNodeInsertedIntoDocumentAtom -4 nsXBLMutationHandler::kNodeInsertedAtom -4 nsXBLMutationHandler::kCharacterDataModifiedAtom -4 nsXBLMutationHandler::kAttrModifiedAtom -4 nsXBLMutationHandler::gRefCnt -4 nsXBLMouseMotionHandler::kMouseMoveAtom -4 nsXBLMouseMotionHandler::gRefCnt -4 nsXBLMouseHandler::kMouseUpAtom -4 nsXBLMouseHandler::kMouseOverAtom -4 nsXBLMouseHandler::kMouseOutAtom -4 nsXBLMouseHandler::kMouseDownAtom -4 nsXBLMouseHandler::kMouseDblClickAtom -4 nsXBLMouseHandler::kMouseClickAtom -4 nsXBLMouseHandler::gRefCnt -4 nsXBLLoadHandler::kUnloadAtom -4 nsXBLLoadHandler::kLoadAtom -4 nsXBLLoadHandler::kErrorAtom -4 nsXBLLoadHandler::kAbortAtom -4 nsXBLLoadHandler::gRefCnt -4 nsXBLKeyHandler::kKeyUpAtom -4 nsXBLKeyHandler::kKeyPressAtom -4 nsXBLKeyHandler::kKeyDownAtom -4 nsXBLKeyHandler::gRefCnt -4 nsXBLFormHandler::kSubmitAtom -4 nsXBLFormHandler::kSelectAtom -4 nsXBLFormHandler::kResetAtom -4 nsXBLFormHandler::kInputAtom -4 nsXBLFormHandler::kChangeAtom -4 nsXBLFormHandler::gRefCnt -4 nsXBLFocusHandler::kFocusAtom -4 nsXBLFocusHandler::kBlurAtom -4 nsXBLFocusHandler::gRefCnt -4 nsXBLDragHandler::kDragOverAtom -4 nsXBLDragHandler::kDragGestureAtom -4 nsXBLDragHandler::kDragExitAtom -4 nsXBLDragHandler::kDragEnterAtom -4 nsXBLDragHandler::kDragDropAtom -4 nsXBLDragHandler::gRefCnt -4 nsXBLContextMenuHandler::kContextMenuAtom -4 nsXBLContextMenuHandler::gRefCnt -24 nsXBLWindowDragHandler::kDragDropAtom -672 (+11/-683) R (DATA) -672 (+11/-683) UNDEF:libgklayout.so:R +7 kCSSType.3204 +4 ioServCID.2700 -7 kInitialPoolSize.1269 -36 kCSSFrameConstructorCID -64 kCollationFactoryCID.2658 -96 nsXBLSpecialDocInfo::sUserHTMLBindingStr -480 kDOMScriptObjectFactoryCID -3424 (+20/-3444) T (CODE) -3424 (+20/-3444) UNDEF:libgklayout.so:T +8 nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *) +4 atexit +4 nsXMLElement::GetXMLBaseURI(nsIURI **) +4 nsXMLElement::SetAttr(nsINodeInfo *, nsAString const &, int) -24 XULContentSinkImpl::XULContentSinkImpl(unsigned int &) -28 XULContentSinkImpl::~XULContentSinkImpl(void) -36 nsXBLMouseMotionHandler::~nsXBLMouseMotionHandler(void) -36 nsXBLContextMenuHandler::~nsXBLContextMenuHandler(void) -40 nsXBLMouseMotionHandler::nsXBLMouseMotionHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -40 nsXBLContextMenuHandler::nsXBLContextMenuHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -56 nsXBLFocusHandler::~nsXBLFocusHandler(void) -60 nsXBLFocusHandler::nsXBLFocusHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -80 nsXBLScrollHandler::~nsXBLScrollHandler(void) -80 nsXBLKeyHandler::~nsXBLKeyHandler(void) -84 nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement *, nsIDOMEventReceiver *) -84 nsXBLScrollHandler::nsXBLScrollHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -84 nsXBLKeyHandler::nsXBLKeyHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -88 nsXBLWindowKeyHandler::~nsXBLWindowKeyHandler(void) -100 nsXBLLoadHandler::~nsXBLLoadHandler(void) -104 nsXBLLoadHandler::nsXBLLoadHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -124 nsXBLWindowDragHandler::~nsXBLWindowDragHandler(void) -124 nsXBLFormHandler::~nsXBLFormHandler(void) -124 nsXBLDragHandler::~nsXBLDragHandler(void) -128 nsXBLWindowDragHandler::nsXBLWindowDragHandler(nsIDOMEventReceiver *) -128 nsXBLFormHandler::nsXBLFormHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -128 nsXBLDragHandler::nsXBLDragHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -140 nsXMLElement::nsXMLElement(void) -148 nsXBLMouseHandler::~nsXBLMouseHandler(void) -152 nsXBLMouseHandler::nsXBLMouseHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -152 XULSortServiceImpl::XULSortServiceImpl(void) -160 nsXMLElement::~nsXMLElement(void) -172 nsXBLXULHandler::~nsXBLXULHandler(void) -172 nsXBLMutationHandler::~nsXBLMutationHandler(void) -176 nsXBLXULHandler::nsXBLXULHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -176 nsXBLMutationHandler::nsXBLMutationHandler(nsIDOMEventReceiver *, nsXBLPrototypeHandler *) -216 XULSortServiceImpl::~XULSortServiceImpl(void)
Priority: -- → P2
Target Milestone: mozilla1.4beta → mozilla1.5alpha
Is there more work to be done here?
Hmm. There are no more consumers of NS_NewPermanentAtom.. My guess is that we're done here. I'll mark FIXED and reopen if necessary.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Blocks: 213939
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: