bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

eliminate use of function pointers in nsRuleNode

RESOLVED DUPLICATE of bug 210550

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 210550
16 years ago
15 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

There are two places in nsRuleNode where we use function pointers but could
probably use a switch statement or something similar.  We originally started
using function pointers because it was shown to be faster.  However, a switch
(perhaps in order by style struct ID, if the old one wasn't? -- which we'd
automatically get by using nsStyleStructList.h) or some sort of hand-coded
binary search might be faster.  See bug 87229 for the previous work.
(sfraser suggested that the access to the global data, where the function
pointers are, is particularly bad on Mach-O.)

Comment 2

16 years ago
Actually, my pageload tests showed that changing it from using a static table to
using a switch had negligible impact on performance. A more isolated test would
be needed to show up differences more accurately.

There may be other areas in which frequent accesses of global data hurt
performance on Mach-O: for instance, comparisons against the static layout
atoms. Sampling a run of the pageload tests shows __cxa_get_globals as the most
common function at the top of the stack (after functions that can context switch).
Hey, I filed the same bug twice.

*** This bug has been marked as a duplicate of 210550 ***
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.