From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70036: 30.0.50; Move file-truename to the C level Date: Thu, 28 Mar 2024 11:59:46 +0100 Message-ID: <87v856wrj1.fsf@thornhill.no> References: <87le63xzjt.fsf@thornhill.no> <87jzlmd831.fsf@localhost> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1582"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70036@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 28 12:01:21 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpnVY-0000Da-Jk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Mar 2024 12:01:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpnVI-0005Pa-9V; Thu, 28 Mar 2024 07:01:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpnVG-0005PI-6a for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 07:01:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpnVF-0007qx-TY for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 07:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpnVG-0001wc-90 for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 07:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Mar 2024 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70036 X-GNU-PR-Package: emacs Original-Received: via spool by 70036-submit@debbugs.gnu.org id=B70036.17116236027101 (code B ref 70036); Thu, 28 Mar 2024 11:01:02 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 28 Mar 2024 11:00:02 +0000 Original-Received: from localhost ([127.0.0.1]:39184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpnUG-0001ps-HY for submit@debbugs.gnu.org; Thu, 28 Mar 2024 07:00:01 -0400 Original-Received: from out-175.mta0.migadu.com ([2001:41d0:1004:224b::af]:55273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpnUD-0001ox-Kw for 70036@debbugs.gnu.org; Thu, 28 Mar 2024 06:59:59 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1711623590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zch7rFV8HCf+VNhzYWcqY5WKqV7oAXOYHpMMUreB8pg=; b=ZXmm7iPhSQ/USZPana6jrNNid6YYfuIF4juD+Yr+1QbZ0jJaMCqcRPXuq10RV67f8aGqe7 nZuXJbIqCNJhlzFdlkIt/KX788uq3D0uMY+tXrGtI0kUbLcUiY0wPheiU0KQmsYZ7O2Gwa eE2Cr5bZqOVxWB5sqqBBLaUGwMqOtQ7HZklaMgkTvpv95RuXBY8KPbCVoqgIA0TejrpEfp iRlCdfl+YGKzxTITGSnMA98fIY4ASIagfHToyBrcdBYpzcjtIU2hpXDR8F/Hf9VKc+FWIs 38QJUaKCiN0wQLmwqP4qx6ZNnjIybnyc+ReHkgyZrfKkC6jSxUEARSqt0Zue4Q== In-Reply-To: <87jzlmd831.fsf@localhost> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282211 Archived-At: Ihor Radchenko writes: > Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife > of text editors" writes: > >> Firstly, I'll show some benchmarks >> >> ``` >> ;; Emacs 29 branch >> >> (benchmark-run 10000 >> (file-truename "~/Work/some/long/path/to/parse/that/is/very/deep/deep/deep/super/duper/deep/deep.el")) >> ;; (1.810892642 1 0.051070616) >> ... >> Below are the profiles and the patch. On my system I needed to `ln -s >> lisp/loadup.el .` to make it compile. Not sure if that is due to >> differences between old and new `file-truename`, or something else. > > The profiles look fishy. For example, in emacs-30-before > 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% - # 15439 72% - elisp--eval-last-sexp 15436 71% - eval 15436 71% - benchmark-call 15434 71% - # 15434 71% - file-truename 13536 63% - file-truename 12224 57% - file-truename 10970 51% - file-truename 9673 45% - file-truename 8468 39% - file-truename 7420 34% - file-truename 6374 29% - file-truename 5286 24% - file-truename 4275 19% - file-truename 3313 15% - file-truename 2454 11% - file-truename 1652 7% - file-truename 984 4% - file-truename 376 1% file-truename 1 0% time-since 1 0% execute-extended-command ``` To me this looks like it spends a lot of time in recursive calls Theo