Bug 578506 - multiline edit is way to slow (ui freeze)
Summary: multiline edit is way to slow (ui freeze)
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-01 07:06 EST by Jörg Kubitz CLA
Modified: 2022-03-04 17:33 EST (History)
1 user (show)

See Also:


Attachments
Screenshot sampling.png (125.91 KB, image/png)
2022-02-01 07:06 EST, Jörg Kubitz CLA
no flags Details
Screenshot invocation Count for 100 lines.png (69.06 KB, image/png)
2022-02-01 07:53 EST, Jörg Kubitz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2022-02-01 07:06:12 EST
Created attachment 287944 [details]
Screenshot sampling.png

reproduce:
1. create a file "test.txt"
2. insert 1000 lines: "hello world"\n
3. Find "world" & "Select All"
=>  already "Select all" is slow .. playing an animation of selecting one after the other, but ok...
4. exit the search dialog
5. type "eclipse" (to replace the "world" with "eclipse").
 
=> freeze for some minutes!

even "Replace all" is faster

And when i meanwhile switch the application not even all characters have been replaced.
Comment 1 Jörg Kubitz CLA 2022-02-01 07:53:37 EST
Created attachment 287945 [details]
Screenshot invocation Count for 100 lines.png

To get an idea of the problem i did recorded the invocation count during replacing only n=100 lines. One can see that AbstractDocument.replace is called n times and then n Events are created and then O(n^2) OS calls happen.

kinda strange to see that getLineCount() is that expensive and called so often.