Bug 33587 - Web Inspector: Scrolling editor to the 20Kth line is not smooth.
Summary: Web Inspector: Scrolling editor to the 20Kth line is not smooth.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
Depends on:
Reported: 2010-01-13 04:31 PST by Pavel Feldman
Modified: 2010-01-13 07:24 PST (History)
4 users (show)

See Also:

[PATCH] Proposed change. (14.71 KB, patch)
2010-01-13 04:34 PST, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-01-13 04:31:51 PST
The reason is that highlighter is synchronous. It is fast, but when it is about 20K lines, it still takes seconds. Hence scrolling is not smooth. This change:

1) Simplifies TextModel so that it stores only per-line attributes, no per-char ones
2) Splits highlight() call into updateHighlight (called upon edits) and highlight (called form paint).
3) Invalidates highlight tail using flag instead of clearing it (so that highlight could recover and quit fast).
Comment 1 Pavel Feldman 2010-01-13 04:34:45 PST
Created attachment 46443 [details]
[PATCH] Proposed change.
Comment 2 Timothy Hatcher 2010-01-13 04:46:31 PST
Comment on attachment 46443 [details]
[PATCH] Proposed change.

> +            // User keeps updating the job in between of our timer ticks. Just reschedule self, don't eat CPU (he must be scrolling).

s/he must/they must/

> +        // Highlight 1K lines chunk.
> +        var toLine = Math.min(startLine + 500, this._requestedEndLine);

s/1K lines/500 lines/
Comment 3 Pavel Feldman 2010-01-13 07:24:27 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/TextEditor.js
	M	WebCore/inspector/front-end/TextEditorHighlighter.js
	M	WebCore/inspector/front-end/TextEditorModel.js
Committed r53184