From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#69188: bug#69233: 30.0.50; project-files + project-find-file is slow in large repositories Date: Sun, 5 May 2024 03:29:12 +0300 Message-ID: <2296c5ba-9612-4f17-9246-2dde14a67655@gutov.dev> References: <1b566e9e-eca5-4746-8e31-4155d35ce7a8@gutov.dev> <4e8e8f14-26be-4a50-b47b-a0373ce19b9a@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35595"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69233@debbugs.gnu.org, 69188@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 05 02:30:13 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 1s3Plb-00091G-VB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 May 2024 02:30:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3Pl9-0006Oj-Dy; Sat, 04 May 2024 20:29:43 -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 1s3Pl6-0006NE-Av for bug-gnu-emacs@gnu.org; Sat, 04 May 2024 20:29:41 -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 1s3Pl6-0002Ke-2v for bug-gnu-emacs@gnu.org; Sat, 04 May 2024 20:29:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s3PlS-0005PI-TX for bug-gnu-emacs@gnu.org; Sat, 04 May 2024 20:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 May 2024 00:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69188 X-GNU-PR-Package: emacs Original-Received: via spool by 69188-submit@debbugs.gnu.org id=B69188.171486899120746 (code B ref 69188); Sun, 05 May 2024 00:30:02 +0000 Original-Received: (at 69188) by debbugs.gnu.org; 5 May 2024 00:29:51 +0000 Original-Received: from localhost ([127.0.0.1]:56588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3PlH-0005OX-CC for submit@debbugs.gnu.org; Sat, 04 May 2024 20:29:51 -0400 Original-Received: from wfout6-smtp.messagingengine.com ([64.147.123.149]:33937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3PlB-0005OO-Hj; Sat, 04 May 2024 20:29:49 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 90E821C000BB; Sat, 4 May 2024 20:29:15 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 04 May 2024 20:29:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1714868955; x=1714955355; bh=KtRf4Ouzx6J8NNTDLmDcmHfL09SDMSoCuFh+/D6YN1s=; b= LpDPeLmUXr8c9KsT1n7Zk4a4ySBlyFp6S4if4tBywB0pbMULFii+lkZr/EHgAay6 BfLzaydXebiv1fV15n1PRva7/AMwY9EIrn/LU5fu8VsMsNmFaIDVNKfCi/Fi404Y LYsQpIb8+2khkYEXTCrkI4cDIQJ+abRw0dR3ASNmFyU0a12sUFEKiUDbDX6X1+nX m2UuA91/PBVDJWqSH+5OQrgY9sDQztOMZaRpay/mSMaTxOrDlEmLFdSDNghTTvLh Ug0NRMflQxipkw84vuxvTVScvXg/Z1kP8bHPy3Wmwzg81UC8GuCWsQxSqcvkUyMU okThEIM/xBkz9YnIJgFAwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714868955; x= 1714955355; bh=KtRf4Ouzx6J8NNTDLmDcmHfL09SDMSoCuFh+/D6YN1s=; b=F NdCRAPWSbSt82g2PxKcqWL964ihvCGbJ9bf11dS7CsJq2wtOhN7WRhzKrocvtArJ /xGPhZtmeYKxyxtcFoF51+VuL9EbLdVssXOGS8nlJAL4K31OqT/j4IKrtwFGRxLj GjTD9Rlp0ZOF5nq00Yps0wL8e+7h39ulUzzmNbUpqCD242qWn+eu2J0fBQYGzwBH YNehz+En6mEr/nDR+d2faJyry7bwldW/a9kD5/3aGKiZzkg7uuGZAaYlIe+mtG+z EHrNWDzv2XK8IOg7RRr/dNVRB/aZjB6v4NQ/C2oSKuIw80qFJ6Jr7BX8vzssvM8L AzAPRy1hv5+bfGRqZtD+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvfedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 4 May 2024 20:29:13 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:284473 Archived-At: On 29/04/2024 23:27, Spencer Baugh wrote: > Dmitry Gutov writes: >> On 13/04/2024 05:34, Dmitry Gutov wrote: >>> Both options are relatively clunky, and the second one might also >>> fail to work when DIRS is non-nil (or would have to fall back to >>> absolute names anyway), so I'm leaning toward the first one. It >>> might also allow certain code to be written supporting both relative >>> and absolute names (e.g. a process call both binds default-directory >>> to root and keeps the file names as-is -- the relative ones would be >>> interpreted as such, the rest just as they are interpreted now). >> Here's how that change can look. >> >> The patch should demonstrate both the performance improvements for >> project-find-file and project-find-regexp, and some awkwardness in the >> implementation, chiefly due to backward compatibility. >> >> Guess more tests will be required, at the very least. > I see almost a 50% performance improvement with this patch in my large > private repository, once adding support for project-files-relative-names > in my internal project backend. Seems great so far. > > My benchmarking: > > (let ((proj (project-current))) > (list (benchmark-run 10 (let ((project-files-relative-names t)) (length (project-files proj)))) > (benchmark-run 10 (let ((project-files-relative-names nil)) (length (project-files proj)))))) > > ((17.605295389 28 7.647366087000023) > (29.918302167 57 19.246283027999993)) Nice! Too bad it's still takes ~1.7s to list all the files in the project. Well above the comfortable wait time (ideally <100ms or at least <500ms, I guess).