Closed
Bug 20724
Opened 25 years ago
Closed 25 years ago
[perf] optimize XUL attribute construction
Categories
(Core :: XUL, defect, P3)
Core
XUL
Tracking
()
RESOLVED
FIXED
M13
People
(Reporter: waterson, Assigned: waterson)
References
Details
(Whiteboard: 12/09)
Attachments
(2 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Atomize short values; pool nsXULAttribute objects; etc.
Assignee | ||
Updated•25 years ago
|
Blocks: 9489
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P1
Summary: [perf] optimize XUL attribute construction → [perf] [DOGFOOD] optimize XUL attribute construction
Target Milestone: M12
Updated•25 years ago
|
Whiteboard: PDT-
Comment 1•25 years ago
|
||
we want this, but not dogfood...
Assignee | ||
Comment 2•25 years ago
|
||
bizarre. the bug depending on it is PDT+.
Updated•25 years ago
|
Whiteboard: PDT- → PDT+
Comment 3•25 years ago
|
||
This is PDT+. This bug was filed to specifically address 9489 (which is PDT+).
Updated•25 years ago
|
Whiteboard: PDT+ → [PDT+]
Updated•25 years ago
|
Whiteboard: [PDT+] → [PDT+] 12/07
Assignee | ||
Updated•25 years ago
|
Whiteboard: [PDT+] 12/07 → [PDT+] 12/09
Assignee | ||
Comment 4•25 years ago
|
||
Assignee | ||
Comment 5•25 years ago
|
||
The attached patch atomizes short attribute values. It uses a tagged pointer:
the least-significant bit indicates whether the "mValue" points to a raw
Unicode string or an nsIAtom.
On the bookmarks window, with a 12 character cutoff, we get a 10-to-1 ratio of
atoms to strings while scrolling down four times. Furthermore the atom hit
ratio is incredible: in the 2,000 atom references, and only two unique atoms
are created. This data indicates that "12" seems to be a good magic number: we
good space (and hence time) savings from atomization without wasting time
atomizing rare strings.
This yields a net speedup of about 2%.
Comment 6•25 years ago
|
||
Looks good. One optimization I could suggest is that you sanity check in
SetValueInternal if the values are the same and don't release/addref, since you
might delete the atom and remalloc one. This is just a nitpick though.
Consider it reviewed.
Comment 7•25 years ago
|
||
Also, I'd love to see a new tree widget profile. With both the recycler and
this put into the tree, I want to see what we're taking the hit on now.
Assignee | ||
Comment 8•25 years ago
|
||
As to the addref/release atom thing: I purposefully addref the atom *before*
assigning to the new value so that the atom (if already existing) will not be
decached from the atom table. The degenerate "set-same-value" case results in a
redundant store and some addref/releases, but those are really just noise.
My feeling was that a check-for-equality adds expense to the common case. Make
the degenerate case pay!
As to the profiles: got 'em. Come by whenever and we'll look.
Assignee | ||
Updated•25 years ago
|
Summary: [perf] [DOGFOOD] optimize XUL attribute construction → [perf] optimize XUL attribute construction
Whiteboard: [PDT+] 12/09 → 12/09
Target Milestone: M12 → M13
Assignee | ||
Comment 9•25 years ago
|
||
Value atomization optimization checked in, a=chofmann. Removing [DOGFOOD] and
[PDT+] grafitti, because further attribute optimization will yield overall
gains of only 2-3% according to latest profiles. (Still worth doing, but there
are bigger fish to fry first, and the dependant bug has been marked "fixed",
anyway.)
Assignee | ||
Updated•25 years ago
|
Priority: P1 → P3
Assignee | ||
Comment 10•25 years ago
|
||
Assignee | ||
Comment 11•25 years ago
|
||
hyatt: gimme some code review lovin' for the fixed size allocator patch. it
completely takes nsXULAttribute construction time out of the picture (boosts
scrolling by 2-3%). Yay!
Comment 12•25 years ago
|
||
Looks good stud.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•25 years ago
|
||
fixed size allocator for nsXULAttribute objects checked in.
Comment 14•25 years ago
|
||
BULK MOVE: Changing component from XUL to XP Toolkit/Widgets: XUL. XUL
component will be deleted.
Component: XUL → XP Toolkit/Widgets: XUL
Comment 15•25 years ago
|
||
please ignore, massive spam giving jrgm@netscape.com backlog of XPToolkits
resolved fixed bugs to verify
QA Contact: paulmac → jrgm
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•