Task 1. Start with open IMAP inbox (~1,000 messages), threaded. 2. Begin profile. 3. Sort folder by sender. 4. End profile. Should collect: - content model teardown cost - sorting cost - content model setup cost Profile shows: All CPU time spent on main thread (248msec). - 44% of the time (110msec) spent in one call to XULSortService::Sort(). Of that: - 60% of the time (65msec) is spent in 4,772 calls to XULSortService::InplaceSort(). This calls GetNodeValue 11,508 times, which accounts for 88% of the time in this function. (This all eventually winds up in nsMsgMessageDataSource::createMessageNode.) - 25% of the time (63msec) is spent in five calls to PresShell::ProcessReflowCommands(). - 13% of the time (33msec) is spent in 10 calls to nsWindow::OnPaint() - 7% of the time (18msec) is spent in two calls to nsXULElement::SetFocus(). - 11% of the time is unaccounted for.