Tk Source Code

View Ticket
Login
Ticket UUID: 1755313
Title: Big difference in speed between x and y scrolling in text wi
Type: Bug Version: None
Submitter: luckyluke67 Created on: 2007-07-17 07:17:12
Subsystem: 18. [text] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2023-01-08 19:30:55
Resolution: None Closed By: nobody
    Closed on:
Description:
The y scrolling is significantly slower than the x scrolling for a text widget filled with tagged text.

The attached script displays a text widget with equal width and height. The text inside is arranged so that a given amount of scrolling in x and y shows the same amount of characters, tags, and tagged characters.

Output: time needed to scroll 100% of the total width/height by 10% steps.

Some results:

Tcl/Tk 8.4.15 - Mac OS X 10.4.10 - G4 1.2 GHz
    X scroll :  3 516 756 microseconds per iteration
    Y scroll : 42 130 794 microseconds per iteration

Tcl/Tk 8.4.14 - Linux 2.6.9 - AMD Opteron
    X scroll :    187 251 microseconds per iteration
    Y scroll : 15 521 640 microseconds per tieration

Tcl/Tk 8.5.0a6 - Linux 2.6.9 - AMD Opteron
    X scroll :    194 166 microseconds per iteration
    Y scroll : 16 266 219 microseconds per tieration

Tcl/Tk 8.4.14 - Windows XP SP2 - P4
    X scroll :  1 253 936 microseconds per iteration
    Y scroll : 21 507 107 microseconds per iteration
User Comments: fvogel added on 2017-08-12 09:05:35:

The revised text widget (see branch revised_text) fixes this to the acceptable extent of having very usable scrolling.

Running the provided test script ttext3.tcl in the current core-8-6-branch (legacy text widget) and revised_text branch I get an almost stuck behavior with the former, and a usable scrolling with the latter.

Timings I get (on the same machine) with each version of the text widget:

8.6:
 X scroll:   831239 microseconds per iteration
 Y scroll: 25234600 microseconds per iteration

revised_text:
 X scroll:   714996 microseconds per iteration
 Y scroll:  2643688 microseconds per iteration

So, with revised_text: - Y scrolling takes ~10 times less - Y scrolling is only 3.7 times slower than X scrolling


luckyluke67 added on 2007-07-17 14:17:15:

File Added - 237304: ttext3.tcl

Attachments: