On 4/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,

 I did th3 follwing: With a program, which generates random numbers in
 different formats, I created a file, which consists of _one_ line of
 2097152 characters ("0"-"9","A"-"F").

 To split the line into lines of 72 characters each, I started vim and
 let it read the file.

 I postioned the cursor at position 0 and entered the following in
 normal mode:

 qq72<right>i<return><esc>0q

 Then I did a

 [EMAIL PROTECTED]

 After only 10 or 15 (guessed) executions of the macro the system
 freezes while constantly swapping (?) and became unuseable and did no
 longer respond.

 Even the mouse pointer was nearly unmoveable...

 After heavily and constantly trying I managed to kill the X-session
 and to 'killall -9 vim' from the console to get back my computer.

Hello Meino "the vim killer" Cramer,
I tried your scenario. You need to add 'set ul=-1' to disable undoes, and
'set lz' to disable excess redraws. Even then, vim goes rather slow at
this task.

Indeed, vim grows to >1000MB vm/rss size
size in matter of one minute without ul=-1 (, and growing very fast. )

To make editing of 2MB-long line manageable, I did:
      vim -u NONE file
     :set ul=-1             : disable undos
     :set lz
NOte that 2MB is already "large file". You are now in the area where you want
take "large file" precautions wrt to performance.

This makes vim stay stable in memory size (although still rather large, 632mb).
But it's still slow at splitting 2mb-long lines. It took vim ~4 minutes to
split ~100 lines. So, for a whole 2mb data, it will take vim about
2 hours. You better try this kind of task with perl or C. Or just add
sensible newlines when generating your data.

Yakov

BTW your disk size is irrelevant.
What is  relevant is your RAM size and swap size.

Reply via email to