Comments (24)
What's the reason for dumping the buffer to a text file before searching it? I'd be happy to help make this faster. The plugin is a great idea but right now unfortunately pretty annoying to use.
from tmux-copycat.
from tmux-copycat.
I've set history-limit
as suggested and in a fresh tmux session it takes about 1s to find a match, pressing n takes roughly 350ms to go to next match. Any ideas on how to bring this down?
from tmux-copycat.
I'm having trouble, too; using the set -g history-limit 5000
, I used tmux kill-server
to start over, then typed tmux
to start a new session. I entered echo "http://www.somewebsite.com"
, then ctl+prefix + ctl + U
. It took about three seconds to find the result. This is on a 2018 MBP.
I first began noticing this problem sometime last year; there definitely was a time when it seemed as snappy as in the screencast.
I definitely don't mean to complain: the only reason this is a problem is because the plugin is incredibly useful. But I'd love it if anyone had any insight into what might be going on: this speed makes it a little hard to rely on the plugin the way I used to.
from tmux-copycat.
I did some digging and it looks like the slowness is not caused by dumping the buffer first. By default, copycat dumps up to 9,000,000 scrollback lines, but changing this to even 100 does not make a noticeable difference.
Instead, the bulk of the "lag" comes in the copycat_cancel_bindings function. Whenever copycat mode is started, copycat extends the keybindings it needs for both searching and cancelling. To do this, it parses the output of tmux list-keys
for every key to re-bind the key with its extended value.
For copycat_cancel_bindings
, this is up to about 11 different keys, in addition to the standard "next" and "prev" keys. You can see this for yourself: if you comment out line 53 of copycat_mode_bindings.sh you'll see a noticeable improvement in speed (although this will mess things up).
I am not yet sure what the solution is, but at least now we know where the problem is.
from tmux-copycat.
from tmux-copycat.
Are you sure? in the screencast it looks blazing fast. Maybe there's something I can do to make it faster(?)
from tmux-copycat.
Unbearably slow on my setup as well, hope to get around to profiling....
from tmux-copycat.
Looks to be disk bound performance issues (at least for me)... not sure if its just the amount of external sourcing of bash files or if its that I am an oddball on nixos package manager/wsl. I'll try again later on a less akward setup.
The ~3 seconds for the command to take action kind of matches up with the disk activity in task manager. I'm running a 960 pro, so disk work should be pretty fast.
from tmux-copycat.
on latest model 15" macbook pro and definitely seeing extreme slow down on that hardware too..
latest tmux + kitty (term)
from tmux-copycat.
Are you guys running large tmux scrollback histories, the set -g history-limit
option? If the value of that option is large and you have big pane history I can see how this would need more time. Copycat dumps tmux's history to a file and then searches that file. The bigger the history the more time some of these actions can take.
I use set -g history-limit 5000
. The speed on my machine is not snappy, but not slow either.
from tmux-copycat.
I too would love to be able to use this plugin; however it's unbearably slow for me (it takes multiple seconds after pressing my keybinding for anything to happen) and I believe the culprit is I/O. I work on NFS mounts almost exclusively and the temporary files that copycat is writing are being made in the $CWD. If the temporary directory were made configurable, I could point it to /tmp or /dev/shm (memory) which would make this usable. Please consider making it configurable or make it respect the standard TMP, TMPDIR or TEMP environment variables.
update: My bad, I see that _get_tmp_dir() does use TMPDIR. Guess I'm going to have to find a better way to profile this...
from tmux-copycat.
What's the reason for dumping the buffer to a text file before searching it? I'd be happy to help make this faster. The plugin is a great idea but right now unfortunately pretty annoying to use.
Do you have time/capacity to action this? A lot of people would be very thankful!
from tmux-copycat.
I was able to get a little bit of improvement in my fork here. There is still a delay, although in my (limited) testing it does seem to be significantly less than it is now. I think the remaining delay comes from the actual calls to tmux bind-key
which cannot really be optimized (they have to be done one at a time).
from tmux-copycat.
Would it be possible to bind the keys (maybe different ones to avoid conflicts) once during startup rather than every time copy mode is entered?
from tmux-copycat.
Thanks @gpanders, the changes on your branch make a big difference on my machine... as in this plugin is usable again for me π
from tmux-copycat.
@gpanders's changes make this indeed faster and like they said it still isn't as fast as one would like it's already a huge improvement as this plugin is once again usable, kudos! It also got merged to master over a month ago so no need to do like I did and replace the official release with his branch :)
Don't know if this can be regarded as solved though. I'd guess yes and any future performance issues should go to a new ticket since this has gotten stale and there already are some performance improvements implemented after filing the ticket.
from tmux-copycat.
@okuuva Due to the email I received when you commented, I reinstalled my tmux packages and am happy beyond my ability to describe to find that copycat is much faster than it was. Maybe it could be faster still, butβfor meβit's definitely back into the very usable category. Thanks to everyone who helped improve the situation.
from tmux-copycat.
Also chiming in to confirm this is fast enough to be useful again! π
from tmux-copycat.
Damn! it's blazing fast!! I love it!
Can we get a link to the commit/PR, in case anybody wants to work on an improvement?
It's amazing now. I agree that it could be better, however it is good enough to be usable in a workflow. Love you guys!!
from tmux-copycat.
Hey @gpanders! I saw your fork and I wanted to try it out. I didn't notice changes in speed so I wanted to confirm the way I am installing it. I did a manual installation and cloned the library and called copycat.tmux
in the cloned repo of your fork.
I observed similar speeds but a lot of folks were saying that speeds heavily improved for them so I wanted to confirm my way of installing your fork.
from tmux-copycat.
Hi @hqkhan, my changes were merged into this repo back in January, so you won't see any difference between my fork and this repo right now.
from tmux-copycat.
Btw this issue should be resolved by #148
from tmux-copycat.
Gotcha. That's odd because I tried the repo first and it was really slow for me. I am on WSL-1 and tmux 3.0a
.
from tmux-copycat.
Related Issues (20)
- tmux-yank stops working after one yank when tmux-copycat is present. HOT 13
- [PROPOSAL] Migration to ripgrep HOT 3
- Git status - Long file names are not detected properly HOT 1
- search not working HOT 4
- Is it possible to highlight all matches HOT 2
- Git status file search does not work with multiple panes HOT 1
- n/N bindings on window 6, pane 1 HOT 1
- Ignore $PROMPT text in backward searches HOT 2
- how to search across multiple lines ?
- Add the possibility of jumping forward or backwards from matches using vim syntax
- Anyone made it work with byobu?
- Fails to run without `en_US@UTF-8` locale
- Prefix C-g doesn't match paths starting with ../ HOT 3
- Tmux-copycat stops working after tmux commit f8ad72b2eeafc1146c116f73194a3950aa0c2143
- File search doesnt find files HOT 2
- Use native regex searches in tmux 3.2 HOT 6
- Way to disable a predefined searches. HOT 3
- FR: tmux-copycat (C-a C-u) for url search is not consistent with tmux-urlview
- Git status - issues with fish as default shell while using Allacrity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux-copycat.