Re:My Most Important Project Was a Bytecode Interpreter
by 0xcde4c3db on Thursday September 22, 2016 @10:03AM
(#12556860)
A screen-oriented text editor with undo and search/replace. Can you make it handle a 10MB file without "simple" operations having annoying delays? How about 100MB? 1GB? 100GB? With no line breaks in the file?
[ Parent
| on HN ]
Re:My Most Important Project Was a Bytecode Interpreter
by hawski on Thursday September 22, 2016 @11:52AM
(#12557712)
With both emacs and vim you can certainly edit 500MB file. I concatenated all sources of recent Linux kernel 4.6.3 once. From what I remember it was all .c, .h and .S files. Resulting file has 542MB and 19'726'498 lines. I did it to test the text editor I am working on.
Some stats:
$ time vim -c 'edit kernel-total' -c q
real 0m8.162s
user 0m7.687s
sys 0m0.398s
$ vim kernel-total ^Z
$ ps aux | awk "/kernel-total$/ || NR == 1"
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
hawski 10467 2.7 17.1 805120 670988 pts/2 T 17:41 0:07 vim kernel-total
$ time emacs kernel-total -f kill-emacs
real 0m7.155s
user 0m6.869s
sys 0m0.237s
$ emacs kernel-total ^Z
$ ps aux | awk "/kernel-total$/ || NR == 1"
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
hawski 10825 43.8 14.8 857484 581152 pts/2 T 17:47 0:07 emacs kernel-total
With vim editing is quite smooth and with emacs it feels laggy. I only edited a bit, like entering a new line here and there, moving few pages down, going to the end of the file and to the top again. Saving is sluggish.
Re:My Most Important Project Was a Bytecode Interpreter
by mynewtb on Thursday September 22, 2016 @10:09AM
(#12556888)
Is there any such editor?
Re:My Most Important Project Was a Bytecode Interpreter
by criddell on Thursday September 22, 2016 @11:30AM
(#12557531)
I don't think so. Can a text editor do search and replace on a 100 GB file without a delay? You could construct an index, but that's not going to happen instantaneously either.
Re:My Most Important Project Was a Bytecode Interpreter
by 0xcde4c3db on Thursday September 22, 2016 @09:56PM
(#12561802)
> Can a text editor do search and replace on a 100 GB file without a delay?
I meant that things like simply scrolling through a few pages or inserting/deleting a single character in the middle of the file shouldn't cause noticeable delays. Doing an operation that spans the entire file is different.