From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files Date: Thu, 26 Dec 2019 16:04:01 +0200 Message-ID: References: <9d65284f-7a64-5e9c-ab02-fbbd1be41689@yandex.ru> <87r2bt1tio.fsf@gmx.de> <2cfd53b2-8202-a321-a853-da0c949b0f15@yandex.ru> <6cf8bfa8-3873-d3db-9139-854359027e8a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="125313"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: Michael Albinus , 34343@debbugs.gnu.org To: =?UTF-8?Q?Felici=C3=A1n_?= =?UTF-8?Q?N=C3=A9meth?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 26 15:06:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ikTmT-000WOB-VA for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 15:06:26 +0100 Original-Received: from localhost ([::1]:53904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikTmS-0005pH-B2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 09:06:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57552) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikTl9-0004zF-Ee for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 09:05:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikTl8-0002bD-CK for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 09:05:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikTl8-0002b6-7A for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 09:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ikTl8-00019n-1F for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 09:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2019 14:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34343-submit@debbugs.gnu.org id=B34343.15773690514389 (code B ref 34343); Thu, 26 Dec 2019 14:05:01 +0000 Original-Received: (at 34343) by debbugs.gnu.org; 26 Dec 2019 14:04:11 +0000 Original-Received: from localhost ([127.0.0.1]:55049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikTkJ-00018j-DD for submit@debbugs.gnu.org; Thu, 26 Dec 2019 09:04:11 -0500 Original-Received: from mail-lf1-f66.google.com ([209.85.167.66]:38741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikTkH-00018T-ES for 34343@debbugs.gnu.org; Thu, 26 Dec 2019 09:04:10 -0500 Original-Received: by mail-lf1-f66.google.com with SMTP id r14so18603134lfm.5 for <34343@debbugs.gnu.org>; Thu, 26 Dec 2019 06:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G6bpjXrHAg7JbQgRZkvd0p/UnJSAPYWK/XRi3NT7v2s=; b=oD2NQOX/FZ/OlF+Zs04GGb0efAdsymRiY4yGNmkTC1o8XOinqk5xMnJDjxWwFYwvYN /02tAMGoGmtFd5H11rLyTYg3s7PrkZI6adAYURMQgEHslFTT7pWuxOoDxVdSRFCbhSb/ yOfvkYtk650Oq0yRifGDNPm5RIY1SJM6lqacCBA9B/iYQFxGR5qPHWYe0Xd4SNiF/xuc +pAUnuFfcUc/MJIN59W1J1561H/0PqhRTPzXAkkyB3sZyOk/UHLqGDx2lh2/h40+iws1 Yy1ELGrzqDHLjE4IsqSNQ+SAIeuEEkDN8lyjM0AYfSHh4gukruYDKeMxY6p2+E+Rv2i/ oXjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G6bpjXrHAg7JbQgRZkvd0p/UnJSAPYWK/XRi3NT7v2s=; b=tTm32K9ITy7oeIEVaQcevk1UjEFf2tJJN1s+TJxGMNbEcF8Y3JOSB4RaYNtw+zfem5 LlG1pPPbr9aQDu4yUeSaiiBMj7/ROetBW/TUTrHZj/+Ueej/xyJnPj7iY6Yao95se3gA 1hi5kzV0gIZDEhZjfl/mlN9Cz6yUrg8Ns6RFdqwTPvqAH+k5K7drD6JgJiqn3ANs8tgw gXDiewzTckKMVNKN2W/EkaV04gfKVLr1SmPJVrD+dV3j11pFtXuQ7XKKmFn5MBdyCMPA IBcfgsN9QoVBHHeo/7f7LHQLATdIqxr3ZmlcDy3E2FDXxarWr53FChHXOynlZ/VQ9kzZ ShpA== X-Gm-Message-State: APjAAAVWytggZsYsol/bg/+BNEUlb2xkpKTT2JIZx1Z/0usJLpcXXfmn LOdo0dWsi/EY5Ib3h+IVn5wnMyrSAqU= X-Google-Smtp-Source: APXvYqx2LxQX0f8BNaoVbILaivIh/7CJGvFHASLL3FHSRTEQNMlkGUgCannkHB/onvOSEokGe7RjlQ== X-Received: by 2002:ac2:4c2b:: with SMTP id u11mr26398183lfq.46.1577369042972; Thu, 26 Dec 2019 06:04:02 -0800 (PST) Original-Received: from [192.168.0.100] ([94.229.108.16]) by smtp.googlemail.com with ESMTPSA id p12sm13101504lfc.43.2019.12.26.06.04.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Dec 2019 06:04:02 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173782 Archived-At: On 08.03.2019 10:28, Felicián Németh wrote: > Hi Dmitry, > > I forgot that project-files are new in emacs-27, so there's no need to > worry about backward compatibility. Also, there is no need to hurry > either, because emacs-27 won't be released soon. Emacs 27 is approaching now. :-) >> So I wonder if somebody has an opinion on that. Maybe we'll want to >> include remote files as "external roots" in some projects? Or files >> inside archives? > > I never worked on a project with multiple remote-ids. However, if we > can come up with something simple that does not have significant > performance impact on the local case, we should solve the general case, > I think. Remote operations tend to be slow, so I think project.el can > run more complex algorithms in that case. I've done some benchmarking. If the project is big (e.g. gecko-dev with 200000+ files), and it resides locally, and the hdd is fast, and we can fetch the list of files quickly (i.e. it uses Git), (seq-group-by #'file-remote-p all-files) is pretty slow. For instance, in that example on my machine, (project-files (project-current)) takes 1.6s. And (seq-group-by #'file-remote-p all-files) itself takes 1s, and (mapcar #'file-local-name files)) takes another 0.9s. While Xargs+Grep only take another 3-4 seconds. So overall the remoteness processing takes a significant portion of the time in the local case even if we do it the smart way (e.g. avoid mapping through #'file-local-name if remote-id is nil). So I've pushed a more simplistic patch to emacs-27 (commit be38e39fcc). Felicián and Michael, please take a look.