[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    [Bug 145686] Large Files open slowly due to futile Syntax-Highlighting
From:       Jaan Vajakas <jaanvajakas () hot ! ee>
Date:       2009-03-29 9:11:13
Message-ID: 20090329091113.0D09715A81 () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=145686


Jaan Vajakas <jaanvajakas@hot.ee> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jaanvajakas@hot.ee




--- Comment #1 from Jaan Vajakas <jaanvajakas hot ee>  2009-03-29 11:11:10 ---
There is much room for optimization of the memory and CPU usage of Kate and
Kwrite with large files.

An example to follow might be the SciTe text editor: I can open a 280 MB XML
file with 9.4 million lines in SciTe with 1 GB RAM on Windows 2000 (I have not
tried SciTe in Linux yet). SciTe shows some syntax highlighting and folding and
although quite sluggish with such large files, it also lets me scroll down or
edit the file. It seems that SciTe initially reads the whole file but only
parses the topmost rows, which makes it open as fast as possible. When
scrolling down, SciTe seems to parse as much as needed. After scrolling to the
bottom, scrolling up and down is very fast, as all the file has been parsed.
After opening the aforementioned file and scrolling to the bottom and waiting
until SciTe has parsed the whole file, SciTe has used 80 seconds CPU time and
uses 680 MB memory for the aforementioned file.

With Kate or KWrite one cannot even dream of opening so large files: even for
plain text files KWrite seems to use multiple times more RAM than the file
size, especially for files with short lines; in case of XML files the memory
overhead is still higher and opening the files takes very long time.

I do not know how SciTe does it, but as for memory usage, Kate could avoid
saving syntax highlighting and displaying information for each line but save it
only for lines near the cursor and, say, each kilobyte of the remaining file.
For a file with 40-byte lines, this would decrease the memory overhead by 25
times! I think a perfect memory overhead might be maybe about 20% of the file
size, as such small overhead would be virtually unnoticeable (SciTe with its
(680-280)/280=140% overhead is not perfect in this sense of course; would the
20% overhead be large enough to get good performance when scrolling the file?).

Acting more user-friendly during time-consuming operations would be very nice
too (by the way, lack of user control during time-consuming operations is a
weak point of most GUIs, including SciTe). But in addition to that, in order to
be of any use for very large files, KWrite and Kate should be seriously
optimized.

My votes for making KWrite/Kate able to open large XML files with reasonable
CPU and memory usage.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic