hexiyou / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

:grep in gvim on Linux is much slower than the same :grep in vim in the various terminal emulators #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the attached script - it will create a file 
~/tmp/gvim-grep-test/grep-me.txt
with repeating lines.
2. Start vim in a konsole and/or gnome-terminal and/or lxterminal and run :grep 
-r house tmp/gvim-grep-test .
3. Do the same inside gvim.
4. Also happens with -u NONE -U NONE.

What is the expected output? What do you see instead?

The gvim commands runs much slower than the console-vim one. 

What version of the product are you using? On what operating system?

I'm using vim-7.3.659-2.mga3.src.rpm on Mageia Linux 3/Cauldron x86-64 on a 
Core i3 machine on top of KDE, but I encountered this issue in Mandriva 
previously and in other desktop environments.

Original issue reported on code.google.com by shlomif@gmail.com on 17 Oct 2012 at 8:24

Attachments:

GoogleCodeExporter commented 9 years ago
On the mailing list (not here on the bug report) Gary Johnson replied and said:

««
I'm not seeing that running Vim 7.3.646 on Fedora 11 under KDE
4.3.1.  Both are pretty fast and gvim is even faster than vim.

Running the following in an xterm,

    time vim -Nu NONE -c 'silent grep -r house tmp/gvim-grep-test' -cq

I got results typically like these:

    real    0m5.128s
    user    0m0.487s
    sys     0m0.495s

Times running in a GNOME Terminal were essentially the same.

Running the following,

    time gvim -f -Nu NONE -c 'silent grep -r house tmp/gvim-grep-test' -cq

I got results typically like these:

    real    0m3.459s
    user    0m0.610s
    sys     0m0.497s

Note that the gvim times are even better than the xterm/vim times,
presumably because of the time xterm needed to write all those lines
to the display.  That's even including the time it takes to just
start gvim, which about a second.

Regards,
Gary
»»

well, I've tried your command-lines and they are indeed comparably fast. 
However (and it's a big "however"), you have done ":silent grep" instead of 
non-silent ":grep". The same command lines with the :silent modifier removed, 
and a carriage return pressed quickly, again yield the problematic behaviour on 
gvim alone.

Can you try it without a ":silent" and report back?

Regards,

-- Shlomi Fish

Original comment by shlomif@gmail.com on 18 Oct 2012 at 7:53