Open Bug 105859 Opened 23 years ago Updated 2 years ago

further reduce refcounting of atoms

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

Future

People

(Reporter: dbaron, Unassigned)

Details

(Keywords: perf)

The fix for bug 92141 greatly reduced the (threadsafe, and thus expensive)
refcounting of atoms by using a permanent atom implementation for all the atoms
in the atom lists.  However, there are probably a few other key places where we
could use permanent atoms for additional performance gain.

A profile of ibench with that fix should that the top places where we AddRef
atoms are (by timer counts):

                 11 nsFontMetricsGTK::GetLangGroup(nsIAtom**)
                  7 nsLanguageAtom::GetLanguageGroup(nsIAtom**)
                  3 nsNodeInfo::GetNameAtom(nsIAtom*&)
                  1 nsTextFrame::TextStyle::TextStyle(nsIPresContext*, etc.)
                  1 nsNodeInfoManager::GetNodeInfo(nsAString const&, etc.)
                  1 nsXULAttribute::GetValueAsAtom(nsIAtom**)
                  1 AtomKey::AtomKey(AtomKey_base const&)
                  1 NS_NewAtom(unsigned short const*)
                  1 NS_NewAtom(nsAString const&)
                  1 nsFontCache::GetMetricsFor(nsFont const&, nsIAtom*, etc.)

The places where we release atoms are similar.

Three of these hits are associated with CSS classes (the three hard-to-attribute
ones), a few with XUL attribute values, a few are associated with other things,
but many are associated with language groups and fonts.
There are also some very commonly used attribute values, such as "true", that
are not in any atom list.  Probably some attribute names, like "hidden" or
"collapsed" (one of them -- I forget which) as well.
Status: NEW → ASSIGNED
Not sure what does this bug really mean. Can you put a simple step-by-step
change here. 
Priority: -- → P4
Target Milestone: --- → Future
QA Contact: chrispetersen → layout
Assignee: dbaron → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.