Re: Runtime of record/play feature

15 views
Skip to first unread message

Manas

unread,
May 13, 2020, 7:25:40 PM5/13/20
to v...@vim.org
Hi, I was recently working on a large CSV file in Vim. I needed to do
some changes in the file and I utilized the recording feature for it.
Recording feature is really awesome and worked well for my use case.

However working on a file whenever applied on multiple lines, it is slow
till the point where we can actually see the edit being done on every line.

I would like to know why is it so slow? Has it something to do with the
design pattern?

Also, is there any consideration of making it faster (if possible)?

--
Manas
Computer Science Undergrad.
IIIT-Delhi 2022

JohnBeckett

unread,
May 14, 2020, 3:09:02 AM5/14/20
to vim_use

> a large CSV file


Roughly how many megabytes? Roughly how long is each line?

Is syntax highlighting active? If so, try disabling the filetype:


:setl ft=


John

Manas

unread,
May 14, 2020, 6:35:50 AM5/14/20
to vim...@googlegroups.com, JohnBeckett

> Roughly how many megabytes? Roughly how long is each line?

I do not exactly remember the size as it was some weeks ago but it was a
2000 line csv (not so big). And it was having around 10 columns.


> Is syntax highlighting active? If so, try disabling the filetype:
>
>
> :setl ft=

Yes, syntax highlighting is active. I used another csv file to do some
fair amount of editing but by disabling filetype I could not see any
major differences in runtime of edit. Although in vanilla vim it's fast
enough.
Really thanks for this.

--
Manas
Undergrad. | 2022

Eli the Bearded

unread,
May 14, 2020, 1:42:54 PM5/14/20
to vim...@googlegroups.com
It's not exactly clear what the problem is based on your limited
description, but my guess is that you are operating on a file that is
huge relative to available RAM and the system is starting to swap to
accommodate the state save for the undo command.

If that's it, disabling undo before you run it might be a good idea.
Usually when I hit that limit, I switch to editing via Perl filter.
The undo.txt help file has a section on "undo-remarks" that provides
guidance on disabling undo effectively to avoid the memory hit.

Elijah

Christian Brabandt

unread,
May 14, 2020, 3:44:28 PM5/14/20
to v...@vim.org
Have you tried :set lazyredraw?
What also helps, is switching away from Vim, (e.g. in a terminal
multiplexer move to a different pane, in the gui, simply minimize the
vim window), so that Vim is not busy redrawing

Best,
Christian
--
Bevor ich ein alter Mann wurde, war ich darauf bedacht, würdig zu
leben. Jetzt, im Alter, richtet sich mein Streben darauf, würdig zu
sterben.
-- Lucius Annaeus Seneca (an Lucilius)
Reply all
Reply to author
Forward
0 new messages