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: Wed, 27 Mar 2024 22:43:25 +0100 Message-ID: <87il17xsea.fsf@thornhill.no> References: <87le63xzjt.fsf@thornhill.no> <87ttkrqvru.fsf@betli.tmit.bme.hu> 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="712"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70036@debbugs.gnu.org To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 27 22:44:44 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 1rpb4d-000AYm-Ko for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Mar 2024 22:44:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpb43-0003Vl-6l; Wed, 27 Mar 2024 17:44:07 -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 1rpb40-0003VU-BA for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 17:44:05 -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 1rpb40-0008WB-2l for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 17:44:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpb3z-0007Q4-R1 for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 17:44:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Mar 2024 21:44:03 +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.171157581928318 (code B ref 70036); Wed, 27 Mar 2024 21:44:03 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 27 Mar 2024 21:43:39 +0000 Original-Received: from localhost ([127.0.0.1]:38459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpb3b-0007Mf-6i for submit@debbugs.gnu.org; Wed, 27 Mar 2024 17:43:39 -0400 Original-Received: from out-170.mta0.migadu.com ([2001:41d0:1004:224b::aa]:37413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpb3X-0007M7-Vq for 70036@debbugs.gnu.org; Wed, 27 Mar 2024 17:43:37 -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=1711575809; 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=zZVzUW60J7luxWcrfDfeCGv95/DR3QBLZVCWlNqGtRY=; b=JYFMtXtKbneFAm6nG0SZ9AvrhFzaFD7HO18wzU1fefrGVpytQWxfyInfuWGV0ecpzWOuH9 vZOn7YlF6kX3QSGy2YfuQzURj287+UAY/+5sRI5z8+HueCELSUnTiP0p6UHMEo9/69LQUU 5bZhSfGofYGmT/byelQQp4hsB1Ywp+QTkQ45F1SuAtmFzYxpnMKgLO0L7FDRhDYspsWpVy TDnjL0YKNSmckHFjR5Qqo136+w+mqeByTU0VvepriAzj/6MdmbtpvcDSVduW1r4GwegAt+ Xo60PgDrCLpE/mMZ5F2hOzQKZgZVVXgfjl+OgiEn8fidfAsbn3+0cF3w3BL52A== In-Reply-To: <87ttkrqvru.fsf@betli.tmit.bme.hu> 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:282159 Archived-At: 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. 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