-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vimcat is much slower than vanilla nvim #239
Comments
I will try to speed it up. |
@rkitover any progress? Also an explanation of why you think it's slow would be very helpful. |
I'm sorry I haven't been doing much work on this repo lately. I need to speed up the streaming system, but it is essential for viewing large files or it would hang at the beginning. I can do two things here easily:
|
I played a bit with this today: script -o 100000 -qfc "vim -R --cmd 'set shortmess+=sSF t_ti= t_te=' +redraw +q <file_name_here>" Blasing fast but there's a few things to fix:
I also tried grabbing the buffer via tmux, didn't go so well. |
The main problem with this approach is like you said, it's only the first page. vimcat can also output a single page very fast, especially if I set the first chunk to something bigger or turn off streaming. Your approach may also work if you add some vimscript to page downwards through the whole file. |
Actually, now that I think about it, making the first chunk say, 10k, would mostly fix this problem, what do you think? |
I tried setting the chunk size to 1MiB, but it does not make it any faster. What do you find annoying about it? It seems pretty fast to me, other than the fraction of a second pause at the very beginning. |
I need to show a lot of file previews, lots. vimcat takes eons, 18 seconds to get 287 lines of bash, that a test I just ran. It could be that I have something wrong in my installation but then it was wrong on my last 3 computers. cCould you try and let me know what you get for time? https://raw.githubusercontent.com/nkh/ftl/main/ftl I'd be delighted to use vimcat if it was faster, I used to alias it to cat but I've become impatient with age ;) I certainly hope it will be fast in the future so I can cat with the same colors as my editor, that's much more ergonomic. As for the short code I posted above, It doesn't even list a whole page in an fzf preview, the spurious elements are a nuisance, speed is just fine. I'll have to spend more time to make it work properly, hopefully you beat me to it and vimcat becomes a speed cat. |
For your real 0m6,996s
user 0m7,285s
sys 0m0,378s . If I run real 0m2,538s
user 0m3,147s
sys 0m0,391s . I suspect that the difference here is because your If it would be possible to get your method to work, that would cut-out the ANSI re-encoding at least, which is done with vimscript, which is not exactly blazing fast. |
https://www.reddit.com/r/vim/comments/vzs658/vimkat_a_rewrite_to_speedup_vimcat/ @rkitover, here's what I have, not polished yet but on its way there. I'm a bit surprised by the time difference between your vimcat run and mine (7s vs 18s), could it be that we use different versions of vimpager/vim? I get 0.5s with vimkat. @BonaBeavis, maybe this fixes your problem too |
@nkh Awesome, I'll take a look. |
Open a file in vim takes less than a second, using vimcat in a terminal takes about 9s to "scroll" to the end of the file.
vimcat -o - .vimrc >> test
takes about 7s.This is a problem, because I would like to use vimcat as a previewer for ranger.
Ranger calls vimcat like this:
Does anyone has an idea?
The text was updated successfully, but these errors were encountered: