GNU bug report logs - #70036
30.0.50; Move file-truename to the C level

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Wed, 27 Mar 2024 19:10:02 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Theodor Thornhill <theo <at> thornhill.no>
To: Felician Nemeth <felician.nemeth <at> gmail.com>
Cc: 70036 <at> debbugs.gnu.org
Subject: bug#70036: 30.0.50; Move file-truename to the C level
Date: Wed, 27 Mar 2024 22:43:25 +0100
Felician Nemeth <felician.nemeth <at> gmail.com> writes:

>> I've been studying Eglots performance and have been noticing a couple
>> of things that I find very interesting. It seems like `file-truename`
>> is in the hot path
>
> I think Eglot repeatedly calls file-truename with the same argument (or
> with an argument from a small set of filenames.)

This is true, to some extent. For the requests, eglot calls it
directly. For some handlers it is called through the function
`find-buffer-visiting`, so I'd say it's advisable to keep the function
itself fast.

>
> I wonder whether it would make sense for Eglot to cache the result of
> file-truename.  Do you think caching would make Eglot faster than it
> currently is?  (Would it still be worth moving file-truename to the C
> level?)

I think it would be faster, yes. This was my first thought as well, but
I quickly threw the first attempts on that away due to the fact that the
processing almost solely lies in that function, and I'd suppose it would
make other parts of emacs faster too. Adding complications to eglot
would likely make the source more complicated rather than better on the
whole. But that's only my opinion. I'd like to try to replicate the
function 1 to 1 in C.

What do you think?

Theo




This bug report was last modified 1 year and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.