-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
counsel-yank-pop is very slow #3040
Comments
Is that an explicit choice on your part, by customising
This should be doable, but note that this would diverge from the built-in behaviour: Another option would be to deduplicate in |
correct
it's still an option, yes. But |
cl-delete-duplicates rapidly slows down on large inputs. Alternatives to the approach in this patch: - Avoid deduplication beyond a certain threshold. - Deduplicate only when kill-do-not-save-duplicates is non-nil. - Make equality test customizable. - Ignore text properties by default. * counsel.el (counsel--idx-of): New macro. (counsel--yank-pop-position): Use it. (counsel-string-non-blank-p): Simplify. (counsel--equal-w-props, counsel--yank-pop-filter): New functions for replicating delete-dups under equal-including-properties. (counsel--yank-pop-kills): Use counsel--yank-pop-filter. (counsel-yank-pop-action-remove): Prefer setq over set. * ivy-test.el (counsel-string-non-blank-p, counsel--equal-w-props) (counsel--yank-pop-filter): New tests. Fixes #3040.
Which Emacs version are you on? If you're on 28 or newer, I think PR #3045 should improve performance. If you can test it before I merge, that would be great; otherwise I'll merge it later this week and everyone can become a tester :). |
My
(emacs-uptime)
is 80 days so far andkill-ring
has 10k elements in it. The default(benchmark-run (counsel--yank-pop-kills))
runs in 14s, mostly because of two reasons:equal-including-properties
is slowcl-delete-duplicates
is very slow (if I use-distinct
with the same comparator, it's 2.5 times faster)Could you provide the way to customize the way we compare elements in kill-ring or to remove the usage
equal-including-properties
completely (this way we can usedelete-dups
orseq-uniq
).Thanks.
The text was updated successfully, but these errors were encountered: