Giter VIP home page Giter VIP logo

Comments (24)

danijar avatar danijar commented on August 17, 2024 6

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.

gpanders avatar gpanders commented on August 17, 2024 6

from tmux-copycat.

iryan2 avatar iryan2 commented on August 17, 2024 3

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.

neagle avatar neagle commented on August 17, 2024 1

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.

gpanders avatar gpanders commented on August 17, 2024 1

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.

bruno- avatar bruno- commented on August 17, 2024

from tmux-copycat.

christopher-francisco avatar christopher-francisco commented on August 17, 2024

Are you sure? in the screencast it looks blazing fast. Maybe there's something I can do to make it faster(?)

from tmux-copycat.

 avatar commented on August 17, 2024

Unbearably slow on my setup as well, hope to get around to profiling....

from tmux-copycat.

 avatar commented on August 17, 2024

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.

capture

from tmux-copycat.

megalithic avatar megalithic commented on August 17, 2024

on latest model 15" macbook pro and definitely seeing extreme slow down on that hardware too..

latest tmux + kitty (term)

from tmux-copycat.

bruno- avatar bruno- commented on August 17, 2024

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.

cpakkala avatar cpakkala commented on August 17, 2024

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.

sabrehagen avatar sabrehagen commented on August 17, 2024

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.

gpanders avatar gpanders commented on August 17, 2024

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.

danijar avatar danijar commented on August 17, 2024

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.

jrolfs avatar jrolfs commented on August 17, 2024

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.

okuuva avatar okuuva commented on August 17, 2024

@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.

neagle avatar neagle commented on August 17, 2024

@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.

iryan2 avatar iryan2 commented on August 17, 2024

Also chiming in to confirm this is fast enough to be useful again! πŸ™Œ

from tmux-copycat.

christopher-francisco avatar christopher-francisco commented on August 17, 2024

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.

hqkhan avatar hqkhan commented on August 17, 2024

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.

gpanders avatar gpanders commented on August 17, 2024

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.

gpanders avatar gpanders commented on August 17, 2024

Btw this issue should be resolved by #148

from tmux-copycat.

hqkhan avatar hqkhan commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.