Skip to content
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

Speed up counsel-yank-pop on large kill-ring #3045

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

basil-conto
Copy link
Collaborator

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.

Fixes #3040.

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 (#3045).
(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.
@basil-conto basil-conto force-pushed the blc/eq-incl-props branch from e25b1a9 to d8dace9 Compare May 2, 2024 07:45
@basil-conto basil-conto merged commit d8dace9 into master May 2, 2024
32 checks passed
@basil-conto basil-conto deleted the blc/eq-incl-props branch May 2, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

counsel-yank-pop is very slow
1 participant