-
Notifications
You must be signed in to change notification settings - Fork 71
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
persp-maybe-kill-buffer is too slow #168
Comments
I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in |
Thank you for the suggestions @gcv, I'm starting debugging to focus the problem... I'll report back to you ASAP ;) |
Hi @gcv, after nights of debugging I can't manage to trigger the mentioned bug... maybe @deejayem, @ibytao, and @dpassen can give some context. I would like to design some regression tests... I see there was a discussion about the recursive minibuffer in #163... I tried How should I setup Emacs 27.2 to reproduce the bug #167? I'm on Gentoo GNU/Linux, by the way. What sequence of commands should I execute? Thank you all. In the meantime, I'll keep trying ;) |
Thanks for looking into it. Don’t worry about that bug specifically. Commit 6e87eeb in master worked around it. I commented out Maybe just adding a simple heuristic would be enough. Like assuming every buffer name that starts with a space (“hidden” buffer) can automatically be killed because none of them belong to a perspective. Not sure. I still really like the intent behind Feel free to look at my Emacs configuration (27.2, Mac) for inspiration: https://github.com/gcv/dotfiles/tree/master/emacs |
@mehw: I put in a hack to allow killing temporary buffers (which we should not care about) without the expensive check. See 672d02d. Then I reenabled the check, but hid it behind a feature flag, and turned it off by default: 248b4e9 — tests are now passing again. I'll try running the code with |
@gcv: Thank you. I'll take a look this week-end. I'm sorry for answering you only now... crazy weeks ;) |
@gcv: Hi, I managed to speed up the processing further... I'm currently perfecting the code. Expect a PR soon ;)
Benchmarks reveal that the processing could be sped up going bare metal, beyond the utility functions, accessing directly the data.
It's working on temporary buffers killed directly with |
Unset feature flag by default, due to nex3#168 possibly beeing fixed.
Set feature flag by default, due to nex3#168 possibly beeing fixed.
Unset feature flag by default, due to nex3#168 possibly beeing fixed.
Set feature flag by default, due to nex3#168 possibly beeing fixed.
Unset feature flag by default, due to nex3#168 possibly beeing fixed.
Set feature flag by default, due to nex3#168 possibly beeing fixed.
I had to comment out
persp-maybe-kill-buffer
use inkill-buffer-query-functions
. See 3e4efab.persp-maybe-kill-buffer
is pretty slow since it does a lot of traversing across perspectives and buffers. And it gets called a lot, especially with some more sophisticated packages like Helm and Magit that create and destroy buffers all the time.This is possibly related to the problem in #167. Because I removed some expected behavior, tests are now failing.
@mehw: Could you please look into fixing this? Thanks!
The text was updated successfully, but these errors were encountered: