all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: 70036@debbugs.gnu.org
Subject: bug#70036: 30.0.50; Move file-truename to the C level
Date: Thu, 28 Mar 2024 12:41:08 +0100	[thread overview]
Message-ID: <875xx6y46j.fsf@thornhill.no> (raw)
In-Reply-To: <87r0futxj4.fsf@localhost>

Ihor Radchenko <yantar92@posteo.net> writes:

> Theodor Thornhill <theo@thornhill.no> writes:
>
>> Not sure I understand what you mean. I tried it again, but this time the
>> call is 100000 times and in an existing file on my system which is
>> deeply nested. I run emacs with `emacs -Q` from a build on
>> `30b1b0d7cd8e4d46a601e9737350cda970f6bab0`.
>>
>> the relevant part from the profile this time:
>> ```
>>        15478  72% - command-execute
>>        15440  72%  - funcall-interactively
>>        15439  72%   - eval-last-sexp
>>        15439  72%    - #<compiled-function 0C4>
>>        15439  72%     - elisp--eval-last-sexp
>>        15436  71%      - eval
>>        15436  71%       - benchmark-call
>>        15434  71%        - #<lambda E8B>
>>        15434  71%         - file-truename
>>        13536  63%          - file-truename
>>        12224  57%           - file-truename
>> ...
>> To me this looks like it spends a lot of time in recursive calls
>
> No. It is just that your `file-truename' is native-compiled and the
> profiler is unable to get the details from inside native subr code.
>
> You can re-evaluate the defun to reveal the details in the profiler
> output. Or use Emacs compiled without native-compilation support.
>
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>

I'm sorry, but I don't see the real difference here. Yes, the profile is
more detailed this way, but it doesn't change the fact that
file-truename is slow, does it?

The question to me is whether or not this is an acceptable performance
hit to take for eglot given what it's trying to do, and my opinion is
no. Whether or not it should be moved to C is open to suggestion. I'm
preparing a patch that only targets Eglot by removing reliance on this
function.

Theo

```
       17839  63% - command-execute
       17794  63%  - funcall-interactively
       17793  63%   - eval-last-sexp
       17793  63%    - #<compiled-function EF0>
       17793  63%     - elisp--eval-last-sexp
       17791  63%      - eval
       17791  63%       - benchmark-call
       17788  63%        - #<lambda 219>
       17783  63%         - file-truename
       17576  62%          - let
       17546  62%           - while
       17529  62%            - let
       17358  61%             - if
       17356  61%              - let
       16365  58%               - or
       15969  56%                - if
       15964  56%                 - let
       15951  56%                  - file-name-as-directory
       15824  56%                   - file-truename
       15788  56%                    - let
       15768  56%                     - while
       15712  55%                      - let
       15579  55%                       - if
       15577  55%                        - let
        7224  25%                         - or
        3429  12%                          - if
        3325  11%                           - let
        3059  10%                            - file-name-as-directory
        1866   6%                             - file-truename
        1501   5%                              - let
        1276   4%                               - while
        1121   3%                                - let
        1004   3%                                   find-file-name-handler
          18   0%                                   if
          49   0%                                - setcar
          26   0%                                   1-
          37   0%                                - if
          23   0%                                   <
          36   0%                                  not
          97   0%                               - if
          46   0%                                - eq
           8   0%                                   quote
           7   0%                                 or
         218   0%                              - cond
         112   0%                               - and
          95   0%                                - string=
          73   0%                                   substring
          82   0%                               - or
          57   0%                                  string=
          17   0%                                or
         123   0%                            - setcar
          83   0%                             - cons
```





  reply	other threads:[~2024-03-28 11:41 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 19:08 bug#70036: 30.0.50; Move file-truename to the C level Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 19:44 ` Eli Zaretskii
2024-03-27 21:56   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  1:14     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  3:05       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  7:04         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  7:03       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  6:22     ` Eli Zaretskii
2024-03-28  7:03       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 20:12 ` Felician Nemeth
2024-03-27 21:43   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  6:03     ` Eli Zaretskii
2024-03-28  7:10       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  8:52         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 11:55         ` Felician Nemeth
2024-03-28 12:08           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30  9:46             ` Felician Nemeth
2024-03-30 11:18               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 12:45               ` Eli Zaretskii
2024-03-31 12:57                 ` Felician Nemeth
2024-03-31 13:32                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  9:22 ` Ihor Radchenko
2024-03-28 10:59   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 11:18     ` Ihor Radchenko
2024-03-28 11:41       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-28 11:51         ` Ihor Radchenko
2024-03-28 12:47           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 13:52           ` Eli Zaretskii
2024-04-18 15:32 ` bug#70036: a fix that João Távora
2024-04-18 15:39   ` João Távora
2024-04-18 15:40   ` Ihor Radchenko
2024-04-18 15:45     ` João Távora
2024-04-18 15:49   ` Eli Zaretskii
2024-04-18 16:11     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:15       ` João Távora
2024-04-18 16:29         ` Eli Zaretskii
2024-04-18 17:22           ` João Távora
2024-04-18 17:53             ` Eli Zaretskii
2024-04-18 20:21               ` João Távora
     [not found]                 ` <874jbycrd7.fsf@dick>
2024-04-18 21:26                   ` João Távora
2024-04-18 21:37                     ` João Távora
2024-04-19  9:17                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 21:32                 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 22:06                   ` João Távora
2024-04-18 23:59                     ` João Távora
2024-04-19  6:09                       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  6:26                         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  8:06                           ` João Távora
2024-04-19  9:05                             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  8:01                         ` João Távora
2024-04-19  9:10                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  9:22                             ` João Távora
2024-04-19  5:58                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  7:52                       ` João Távora
2024-04-19  9:14                         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  6:56                     ` Eli Zaretskii
2024-04-19  7:51                       ` Ihor Radchenko
2024-04-19 10:51                         ` Eli Zaretskii
2024-04-19  8:27                       ` João Távora
2024-04-19  8:49                         ` João Távora
2024-04-19 11:12                           ` Eli Zaretskii
2024-04-19 11:34                             ` João Távora
2024-04-19 18:13                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 18:59                                 ` João Távora
2024-04-19 19:42                                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:01                         ` Eli Zaretskii
2024-04-19 11:32                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:40                             ` João Távora
2024-04-19 11:47                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:51                                 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:01                                   ` João Távora
2024-04-19 11:51                                 ` João Távora
2024-04-19 20:23                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 21:32                                 ` João Távora
2024-04-19 11:53                             ` Eli Zaretskii
2024-04-19 11:59                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:03                               ` João Távora
2024-04-19 12:00                           ` João Távora
2024-04-19 12:13                             ` Eli Zaretskii
2024-04-19 12:20                               ` João Távora
2024-04-19  6:45                   ` Eli Zaretskii
2024-04-19  7:38                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:54                     ` João Távora
2024-04-19 14:32                       ` Eli Zaretskii
2024-04-19  0:57                 ` Yuan Fu
2024-04-19  1:20                   ` João Távora
2024-04-22 22:11                 ` Dmitry Gutov
2024-04-18 16:21       ` Eli Zaretskii
2024-04-18 16:12     ` João Távora
2024-04-18 16:24       ` Eli Zaretskii
2024-04-18 16:33         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:36           ` Eli Zaretskii
2024-04-18 17:26           ` João Távora
2024-04-18 17:27         ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xx6y46j.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70036@debbugs.gnu.org \
    --cc=theo@thornhill.no \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.