[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master c59e878: Inhibit modification hooks when saving eieio-persist

From: Stefan Monnier
Subject: Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
Date: Sat, 02 May 2020 09:26:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> Do you still see the performance problem if you don't enable
>> `on-screen`?
> There are other similar "culprits" as well, all are private things.
> When I turn them all off, everything is good.

Sounds like performance problems in your "culprits", then.
`before/after-change-functions` are functions that can be called *many*
times within a single command and for this reason they have to be
careful about their performance impact.

E.g. for `on-screen`, AFAICT the after-change-function is only there to
remove the highlighting when you modify the buffer (tho, AFAICT it
doesn't seem to work in my tests, so maybe I misunderstand it).

So IIUC, your after-change-function only need to be installed in those
buffers where there is highlighting to be removed.  IOW, the hook
function should be added to the buffer when you add highlighting to it,
and then removed when you remove the highlighting.  This will also
ensure that it will only be called once per command in any given buffer.

>> Not necessarily: it could be too slow (because of the cost to
>> enter/leave `combine-change-calls`).
> You mean when it's called in iteration?  That makes sense.

Another reason is that we don't know that `object-write` is only called
in temp buffers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]