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 08:10:28 +0100 Message-ID: <874jcqygpn.fsf@thornhill.no> References: <87le63xzjt.fsf@thornhill.no> <87ttkrqvru.fsf@betli.tmit.bme.hu> <87il17xsea.fsf@thornhill.no> <86wmpmhp0a.fsf@gnu.org> 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="39413"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70036@debbugs.gnu.org, felician.nemeth@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 28 08:11:28 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 1rpjv6-000A6h-Iy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Mar 2024 08:11:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpjun-0006BG-Jo; Thu, 28 Mar 2024 03:11:09 -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 1rpjum-0006Ar-CK for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 03:11:08 -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 1rpjum-0002Mt-3M for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 03:11:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpjum-0000Ml-2q for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 03:11:08 -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 07:11:07 +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.17116098481293 (code B ref 70036); Thu, 28 Mar 2024 07:11:07 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 28 Mar 2024 07:10:48 +0000 Original-Received: from localhost ([127.0.0.1]:38911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpjuQ-0000KX-2O for submit@debbugs.gnu.org; Thu, 28 Mar 2024 03:10:48 -0400 Original-Received: from out-175.mta0.migadu.com ([91.218.175.175]:57343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpjuL-0000JU-9Z for 70036@debbugs.gnu.org; Thu, 28 Mar 2024 03:10:43 -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=1711609834; 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=abEmjJWFPetvcclYMyYRISoFipxOfAjtUlb0dxNIXa4=; b=xoSsxs0fT+IakAHvuyuL3xfPd9/ZSRyL3PFjGciYy/cyuEGCDVZL1to78696qsDAE1B8eQ 4OkVnyOepzCRSBssxQPAlRRwv1KaTJaon7qDkfHHojURWKVo9GExkkY1iWxL1tHNhlVgjz 3W9O7RJczgZaQjhmHdw9Llx6VyuN22SklBD/Rs1fdNj1SkPhdCLRbyn8OhzhcMHaBpWLvx 89IYhRy+bhIgyFtCg0qgURQ0kVkEgTochxqkaFxFb/urBtqXe/EhNk5vZ4FoNPbKDbp2Wk HGzKzq85tjIdmpotR7tkGMiqDmIV1Rbm6bCroYbUKpNnCtOphXxYpjYdTeuN2g== In-Reply-To: <86wmpmhp0a.fsf@gnu.org> 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:282184 Archived-At: Eli Zaretskii writes: >> Cc: 70036@debbugs.gnu.org >> Date: Wed, 27 Mar 2024 22:43:25 +0100 >> From: Theodor Thornhill via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Felician Nemeth 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. > > Can someone explain why Eglot needs to call file-truename in the first > place? I tried quickly just replacing file-truename with expand-file-name, and from some quick testing, it seems to work, and of course remove file-truenames slow performance in the profiles: ``` @@ -1085,7 +1089,7 @@ eglot-uri-to-path (defun eglot-path-to-uri (path) "Convert PATH, a file name, to LSP URI string and return it." - (let ((truepath (file-truename path))) + (let ((truepath (expand-file-name path))) (if (and (url-type (url-generic-parse-url path)) ;; It might be MS Windows path which includes a drive ;; letter that looks like a URL scheme (bug#59338) ``` This wouldn't help for the usage in find-buffer-visiting, though. But this one could more easily be replaced by reworking the diagnostics handler. We could store the last received diagnostics in the server object, and do a quick lookup from known buffers there. Theo