Task: 1. Start with open IMAP inbox (~1,000 messages), threaded. 2. Begin profile. 3. Switch to IMAP sent folder (~2,000 messages), unthreaded. 4. End profile. Should collect: - teardown cost of Inbox content model - setup cost of sent content model Profile shows: All CPU time spent on main thread (1542msec). - 28% of the time (432msec) spent in two calls to nsXULDocument::RebuildWidgetItem() - 34% of this time (147msec) spent in XULSortServiceImpl::InsertContainerNode(), inserting nodes into the content model. This is dominated by the sorting routines. - 16% of this time (68msec) spent in nsMessageViewEnumerator::HasMoreElements(), reading the RDF container. - 9% of the time (38msec) is spent in 4,200 calls to nsXULElement::SetAttribute(). This is dominated by attribute creation cost. - 7% of this time (32msec) spent in InstantiationNode::Propogate(), which is purely nsXULTemplateBuilder overhead - 5% of the time (20msec) spent creating nsXULElement::Create() and nsXULElement::EnsureSlots(), in other words, making content elements. - 18% of the time (277msec) spent in three calls to PresShell::ProcessReflowCommands() - 14% of the time (201msec) spent in one call to nsMsgDatabase::OpenMDB() - 12% of the time (173msec) spent in 157 calls to nsWindow::OnPaint() - 5% of the time (77msec) spent in 126 miscellaneous SetAttribute() calls (triggers style re-resolve, etc.) - 4% of the time (68msec) spent in one call to nsImapFolder::UpdateImapMailboxInfo() - 3% of the time (62msec) spent in two calls to SetContentState(), triggering reflows from two focus changes. - 3% of the teme (48msec) spent in IMAP synchronization primitives (LeaveCriticalSection, ReleaseSemaphore). - 13% unaccounted time.