Open jlc-backsbag opened 1 year ago
Same to me...
It takes 709 ms to yank to system clip board. Maybe it there a good way to faster this?
example:
$ start=$[$(date +%s%N)/1000000] && echo "abc" | win32yank.exe -i && end=$[$(date +%s%N)/1000000] && echo `expr $end - $start`
709
Hard to be sure, since there is some locking involved. For anecdotal evidence I wrote a couple of tests here to measure time
Time measurements were done by wrapping the calls with std Duration elapsed(), and I'm using debug builds here. Bottom line being that the api calls themselves do not seem to be the problem.
Maybe the delay comes from process execution. For total time I'm using powershell's measure-command
Measure-Command { echo "abc" | .\target\debug\win32yank -i }
and my times ranged from 25 to 33ms. Still much lower that in your case.
@TaylorTrz is this example being executed from wsl or something? that syntax looks very sh-ish. If so, maybe the time would provide more details.
This happens even when not using the system clipboard (yanking using just y not "_y.
This one is surprising. I would not expect this unless using set clipboard=unnamedplus
or similar caused it to always use the clipboard.
@equalsraf Wells, Thanks to your kindly reply.
I do this time cost test from Window Subsystem on Linux (WSL v2.0) , and the average time i test today is 80ms.
Then I tried to use strace to run this, the syscall:
$ echo "abc" | strace -tt win32yank.exe -i
13:07:42.970990 execve("/usr/local/bin/win32yank.exe", ["win32yank.exe", "-i"], 0x7ffe20590130 /* 31 vars */) = 0
13:07:42.977774 socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
13:07:42.981332 accept4(3, {sa_family=AF_VSOCK, sa_data="\0\0\335\223-\221\2\0\0\0\0\0\0\0"}, [16], SOCK_CLOEXEC) = 5
13:07:43.071391 close(5) = 0
13:07:43.073073 +++ exited with 0 +++
So, the time mostly costed by socket poll and recvfrom (AF_VSOCK). I think the average time less than 100ms is good enough for yank/paste.
After installing and using win32yank as the clipboard program in neovim, yanking and pasting have become really slow (~0.5s). This happens even when not using the system clipboard (yanking using just
y
not"_y
.Is there a way to at least remove the delay when yanking to vim-specific registers?