Horizontal scrolling in Orion with very long lines is slow

RESOLVED FIXED in Firefox 11

Status

()

Firefox
Developer Tools
P2
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Ehsan, Unassigned)

Tracking

({perf})

Trunk
Firefox 11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sourceeditor][orion])

STR:

1. Go to <https://bugzilla.mozilla.org/js/yui/yahoo-dom-event/yahoo-dom-event.js?1303753510>, select all, copy.
2. Go to scratchpad, select all, paste.
3. Scroll horizontally.
4. Now go to data:text/html,<textarea rows=10 cols=80 wrap=off>, paste.
5. Scroll horizontally.

The scrolling in textarea is very smooth, the scrolling in scratchpad is slow and choppy.
I profiled this on Mac.  Specifically, I held my mouse down on the right scroll arrow and then started the profiler, waited a bit, and stopped it, using keyboard shortcuts (Option+esc).

The short of it is that 84% of the time is under reflow triggered from getBoundingClientRect calls coming off a scroll event.

I have no idea what the heck Orion is doing from horizontal scroll events, but it may want to stop doing it.  Looking at the profile, it includes at least lots of calls to getBoundingClentRect interspersed with .length gets on textnodes, .firstChild and .nextSibling gets on nodes, CSS property setting, CSS property getting, .scrollLeft gets, .style gets, createDocumentFragment calls (!), .clientHeight gets, .rows gets on tables, .selection gets on windows, .clientWidth gets, .scrollTop gets, .scrollWidth gets, .cells gets on table rows, .documentElement gets, .previousSibling gets, .style.height sets, etc, etc, etc.

The combination of style changes and reflow flushes is presumably what really kills performance here.  Why is Orion doing that, exactly?

Comment 2

6 years ago
This is the upstream bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=354435
That upstream bug is about a hang loading a file with a really really long line in the editor.

We need separate upstream bugs to track this and bug 687865, I think.

Comment 4

6 years ago
(In reply to Boris Zbarsky (:bz) from comment #3)
> That upstream bug is about a hang loading a file with a really really long
> line in the editor.

I put them together thinking that there may be one solution on their end and they can break it up based on the implementation.

But, I think your suggestion to break up the bug is better for ensuring that separate issues don't get lost.

New additional upstream bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=358628

Updated

6 years ago
Summary: Horizontal scrolling in scratchpad with very long lines is slow → Horizontal scrolling in Orion with very long lines is slow
Whiteboard: [sourceeditor][orion]

Comment 5

6 years ago
We're doing developer tool prioritization, filter on 'brontozaur'
to ignore the spam.
Priority: -- → P2

Updated

6 years ago
Depends on: 702331
This bug is now fixed upstream and the code has been integrated, see bug 702331.

If there are other or similar performance issues, please file separate bug reports. Thank you!
Status: NEW → RESOLVED
Last Resolved: 5 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → Firefox 11
You need to log in before you can comment on or make changes to this bug.