emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#70216: closed (30.0.50; self-insert-command doesn't respect create-l


From: GNU bug Tracking System
Subject: bug#70216: closed (30.0.50; self-insert-command doesn't respect create-lockfiles)
Date: Sun, 07 Apr 2024 08:12:02 +0000

Your message dated Sun, 07 Apr 2024 11:11:40 +0300
with message-id <867ch91tj7.fsf@gnu.org>
and subject line Re: bug#70216: 30.0.50; self-insert-command doesn't respect 
create-lockfiles
has caused the debbugs.gnu.org bug report #70216,
regarding 30.0.50; self-insert-command doesn't respect create-lockfiles
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
70216: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70216
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; self-insert-command doesn't respect create-lockfiles Date: Fri, 05 Apr 2024 12:52:39 +0200
Hi all!

I'm digging more and more into the internals of Emacs these days, and
while tracing input lag performance i noticed that we don't respect the
create-lockfiles option, at least not fully.

The documentation states:
```
If the option `create-lockfiles' is nil, this does nothing.
```
However, the nothing is postponed until later, inside the lock_file
function. This means we won't cretae the lockfile, but we will get the
truename-buffer, verify visited file, etc, on my system amounting to
some time spent which I thought I opted out of.

Along with a patch that fixes this behavior I've added 4 screenshots of
graphs taken through intel_pt tracing on trigger of self-insert inside a
c file.

to reproduce what I do, from inside my emacs source code folder:

```
;; normal emacs built from source a couple of days ago
emacs -Q +644 src/filelock.c
emacs -Q -eval "(setq create-lockfiles nil)" +644 src/filelock.c

;; emacs with the provided patch
./src/emacs -Q +644 src/filelock.c
./src/emacs -Q -eval "(setq create-lockfiles nil)" +644 src/filelock.c
```

The first two screenshots show the current behavior without this patch,
where you can see that we still do some lock-file related computing even
though the setting is off. The last two show that we don't do it at all,
while preserving the vanilla operation when create-lockfiles = t.

The lock file related code can take up to a millisecond on my system,
but is usually in the range of 200-300 microseconds.

It seems there was some cleanup/changes around this behavior which i
believe caused this as a regression, from around 3 years ago. I _think_
this commit: 9ce6541ac9710933beca7f9944087fe4849d5ae9

Theo

Attachment: emacs-Q.png
Description: PNG image

Attachment: emacs-Q-create-lockfiles-nil.png
Description: PNG image

Attachment: patched-emacs-Q.png
Description: PNG image

Attachment: patched-emacs-Q-create-lockfiles-nil.png
Description: PNG image

Attachment: 0001-Actually-do-nothing-when-create-lockfiles-is-nil.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#70216: 30.0.50; self-insert-command doesn't respect create-lockfiles Date: Sun, 07 Apr 2024 11:11:40 +0300
> Date: Sun, 07 Apr 2024 08:40:58 +0200
> From: Theodor Thornhill <theo@thornhill.no>
> Cc: 70216@debbugs.gnu.org
> 
> I think we can close this if you don't think this is worth it, at least the 
> docs got fixed :)

Closing.


--- End Message ---

reply via email to

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