Posted 15 years ago
by Bob Rundle
-
Director, Dynamic Workflow,
JOA Oil & Gas BV
I am fixing the SyntaxEditor so that it will effectively load and edit large files. I need to be able to view and edit text files that are well in excess of 1MB (some as large as 100MB). The current design of the syntax editor simply does not support this.
Try creating a simple program that loads a 1MB file and then try to edit it. It will be pitifully slow.
The problem is very basic. When the syntax editor opens a file as a stream it does a ReadToEnd() to load the entire file into a string. Then it puts this string into another buffer. If you insert a character at the beginning, all 1MB characters must be moved down one place. Each time you type a character it does this.
Worse, all the line start character positions are updated for each character inserted.
So I purchased the blueprint version of the syntax editor and I am fixing it. I am putting in a proper multi-threaded lazy load string buffer that will allow you to open a large file and see it immediately. More importantly you will be able to add characters to the string buffer without moving every character down one.
I am just getting started. If anyone has already done this and can help me out I would be very appreciative.
Regards,
Bob Rundle
rundle@rundle.com
Try creating a simple program that loads a 1MB file and then try to edit it. It will be pitifully slow.
The problem is very basic. When the syntax editor opens a file as a stream it does a ReadToEnd() to load the entire file into a string. Then it puts this string into another buffer. If you insert a character at the beginning, all 1MB characters must be moved down one place. Each time you type a character it does this.
Worse, all the line start character positions are updated for each character inserted.
So I purchased the blueprint version of the syntax editor and I am fixing it. I am putting in a proper multi-threaded lazy load string buffer that will allow you to open a large file and see it immediately. More importantly you will be able to add characters to the string buffer without moving every character down one.
I am just getting started. If anyone has already done this and can help me out I would be very appreciative.
Regards,
Bob Rundle
rundle@rundle.com