[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Speed up project-kill-buffers
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] Speed up project-kill-buffers |
Date: |
Mon, 03 May 2021 18:45:29 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> I've noticed that sometimes project-kill-buffers is noticeably slow, and
>> it seems like it's has to do with project--buffer-list working on remote
>> files. The function goes through every buffer and calls
>> (project-current), even if the buffer is related to a remote file that
>> cannot be part of the current project.
>> The patch I attach below is a simple fix to avoid checking files that
>> cannot be part of the current project. Or are there any edge-cases that
>> this code approach breaks?
>
> In theory, files on different hosts could be part of the same "project" (in
> Eli's sense, see
> https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00051.html and the
> other messages in that thread), but we'll get there when we get
> there. Probably by adding a method like project-contains-file-p.
Of course, we could also make the check super fast by keeping the
"current project" in a buffer-local var, and then just look for buffers
which have an `eq` value in that var. That would be both faster than
`file-in-directory-p` and more arguably more correct.
Stefan
- Re: [PATCH] Speed up project-kill-buffers, (continued)
- Re: [PATCH] Speed up project-kill-buffers, Philip Kaludercic, 2021/05/08
- Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/08
- Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/08
- Re: [PATCH] Speed up project-kill-buffers, Stephen Leake, 2021/05/16
- Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/16
- Re: [PATCH] Speed up project-kill-buffers, Stephen Leake, 2021/05/19
- Re: [PATCH] Speed up project-kill-buffers, Stephen Leake, 2021/05/20
- Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/24
- Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/24
Re: [PATCH] Speed up project-kill-buffers, Dmitry Gutov, 2021/05/03
- Re: [PATCH] Speed up project-kill-buffers,
Stefan Monnier <=