Closed Bug 576777 Opened 15 years ago Closed 15 years ago

provide quick access to link index

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access, perf)

Attachments

(1 file)

Attached patch patch — — Splinter Review
IA2 get_hyperlinkIndex is heavy used by AT and web pages loading performance suffers because of this. It's reasonable to cache index of embedded character so we can find quickly embedded object by text offset. I think blindcooltech.com should be loaded even more faster. Though perhaps we should find another more heavy benchmark to see a difference. I moved embedded object collector to nsAccessible because ATK wants to deal with embedded objects always and that allows to prevent keeping a pointer to collector for hypertext accessibles twice (bug 420993), since web pages contains huge amount of hypertext accessibles then it makes sense. However the same time it's inherited by text leafs and that's not desired (though they inherit many undesired members). Later we should work to on accessible classes hierarchy to avoid this.
Attachment #455878 - Flags: superreview?(neil)
Attachment #455878 - Flags: review?(marco.zehe)
Attachment #455878 - Flags: review?(bolterbugz)
I agree, want to file a bug to make hypertext accessibles more lightweight?
(In reply to comment #1) > I agree, want to file a bug to make hypertext accessibles more lightweight? I assume you meant text leaf accessibles. Perhaps we have something but technically we should reconsider whole hierarchy to make it more lightweight and it should be a part of that.
Comment on attachment 455878 [details] [diff] [review] patch r=me thanks! Note that I can't actually detect a difference betwen a current nightly and this build in speed of loading blindcooltech.com. It is simply very fast already that measuring it by user experience is not possible. :-)
Attachment #455878 - Flags: review?(marco.zehe) → review+
Comment on attachment 455878 [details] [diff] [review] patch r=me if this is required for bug 420993 or we can get a good test case for perf improvement.
Attachment #455878 - Flags: review?(bolterbugz) → review+
This is perf bug important for processing of huge HTML pages by AT like NVDA. Needed approval for 2.0.
blocking2.0: --- → ?
(In reply to comment #5) > Comment on attachment 455878 [details] [diff] [review] > patch > > r=me if this is required for bug 420993 right, this is part of bug 420993. > or we can get a good test case for perf > improvement. adding test is really easy. Just grow up any web page (for example, that blindcooltech) in several times and start getLinkAtOffset() for every offset in the hypertext accessible or like var count = text.linkCount; for(var idx = 0; idx < count; idx++) { var link = text.getLinkAt(idx); getLinkIndexAtOffset(link.startIndex); } It makes sense to add it into your perf test suite for tinderbox. Actually I think every fixed perf bug should be there. And it would be great if you would care about this :) since you're on top of this.
Comment on attachment 455878 [details] [diff] [review] patch Sorry for the delay, backlogged after the Summit. > nsAccessible::InvalidateChildren() > { > PRInt32 childCount = mChildren.Length(); > for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) { > nsAccessible* child = mChildren.ElementAt(childIdx); > child->UnbindFromParent(); > } > >+ mEmbeddedObjCollector = nsnull; > mChildren.Clear(); >- mAreChildrenInitialized = PR_FALSE; >+ mChildrenFlags = eChildrenUninitialized; After the children are invalidated, their mIndexOfEmbeddedChild is no longer correct, is it? How do you know that it won't be used before it is recalculated?
(In reply to comment #8) > After the children are invalidated, their mIndexOfEmbeddedChild is no longer > correct, is it? How do you know that it won't be used before it is > recalculated? Yes, mIndexOfEmbeddedChild is -1 and mEmbeddedObjCollector is null. When index in embedded children collection is requested then embedded children collection (mEmbeddedObjCollector) is recreated and index is calculated (EmbeddedObjCollector::GetIndexAt).
(In reply to comment #8) > Comment on attachment 455878 [details] [diff] [review] > patch > > Sorry for the delay, backlogged after the Summit. yes, the same for me
(In reply to comment #9) > (In reply to comment #8) > > After the children are invalidated, their mIndexOfEmbeddedChild is no longer > > correct, is it? How do you know that it won't be used before it is > > recalculated? > Yes, mIndexOfEmbeddedChild is -1 and mEmbeddedObjCollector is null. I see where mEmbeddedObjCollector gets set to null but not where mIndexOfEmbeddedChild gets set to -1.
(In reply to comment #11) > I see where mEmbeddedObjCollector gets set to null but not where > mIndexOfEmbeddedChild gets set to -1. UnbindFromParent()
(In reply to comment #12) > (In reply to comment #11) > > I see where mEmbeddedObjCollector gets set to null but not where > > mIndexOfEmbeddedChild gets set to -1. > UnbindFromParent() So when the parent is invalidated then all the children get unbound?
(In reply to comment #13) > (In reply to comment #12) > > (In reply to comment #11) > > > I see where mEmbeddedObjCollector gets set to null but not where > > > mIndexOfEmbeddedChild gets set to -1. > > UnbindFromParent() > So when the parent is invalidated then all the children get unbound? Yes, that's how things are processed currently, at least for all text accessibles what mEmbeddedObjCollector is used for.
Comment on attachment 455878 [details] [diff] [review] patch Fair enough. I didn't spot anything else interesting.
Attachment #455878 - Flags: superreview?(neil) → superreview+
Keywords: perf
Comment on attachment 455878 [details] [diff] [review] patch this is major perf improvement of big web pages pages loading by screen readers.
Attachment #455878 - Flags: approval2.0?
Severity: normal → major
Marking blocking beta N since we'll want some beta time with this before ship.
blocking2.0: ? → betaN+
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
revert mochitest fix since it fails now (I think Ehsan landed editor fix and text elements aren't exposed for placeholder text) - http://hg.mozilla.org/mozilla-central/rev/d84aff2ae1db
(In reply to comment #19) > revert mochitest fix since it fails now (I think Ehsan landed editor fix and > text elements aren't exposed for placeholder text) - > http://hg.mozilla.org/mozilla-central/rev/d84aff2ae1db I don't really know what the failure was, and less so how the solution works. I can't even confirm that some of my pushes have caused this test to fail. I usually push everything to the try server, and I'm especially wary of a11y test failures.
Alexander, I think this is next to land. We'll need to update the patch and get a clean tryserver run. Note if you need to disable the area 14 tests altogether, r=me.
landed http://hg.mozilla.org/mozilla-central/rev/dec698262ea8 with disabled failing test since it sounds color value depends on platform settings and may vary.
Status: REOPENED → RESOLVED
Closed: 15 years ago15 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: