Closed Bug 501375 Opened 15 years ago Closed 15 years ago

nsHTMLTableAccessible::HasDescendant is much slower than it should be

Categories

(Core :: Disability Access APIs, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

Obvious issues:

1)  It forces a walk over all of the table's kids by getting .length on the
    list.  For cases when the table actually _has_ a kid of the sort this
    algorithm is looking for, this is wholly unnecessary.
2)  It has a bizarre check for whether the first item of the list is the table
    itself.  This can't ever happen.
3)  It does some weird string operations instead of just having the callers pass
    in an NS_LITERAL_STRING().

Issue #1 is by far the most important, of course.
Keywords: perf
Blocks: cleana11y
Attached patch patch (obsolete) — Splinter Review
not tested, it would be nice to get mochitests from bug 495388.
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Depends on: 502154
That patch changed behavior such that if aAllowEmpty is false and the first kid is empty the function will return false where it used to return true....
(In reply to comment #2)
> That patch changed behavior such that if aAllowEmpty is false and the first kid
> is empty the function will return false where it used to return true....

Ah, I see, thank you for the catch.
(In reply to comment #2)
> That patch changed behavior such that if aAllowEmpty is false and the first kid
> is empty the function will return false where it used to return true....

Sorry I was quick to say I see. Do you mean the case when length > 1?
Er, yes.  Sorry, forgot to mention that.
Attached patch patch2Splinter Review
Attachment #386676 - Attachment is obsolete: true
Attachment #386795 - Flags: superreview?(bzbarsky)
Attachment #386795 - Flags: review?(marco.zehe)
Attachment #386795 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 386795 [details] [diff] [review]
patch2

r=me, thanks!
Attachment #386795 - Flags: review?(marco.zehe) → review+
checked in on 1.9.2 - http://hg.mozilla.org/mozilla-central/rev/7ed7057a36c7
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: