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, 2 Jan 2020 04:22:16 +0300 Message-ID: <7a1e2e22-89d4-b8b9-6cd4-e6947436138c@yandex.ru> 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> <87h81mqiq5.fsf@gmx.de> <0ff03b20-20d8-b6c0-c876-3fd525586180@yandex.ru> <87mubdps6s.fsf@gmx.de> <87blrsz3tf.fsf@gmx.de> <87blrrmht9.fsf@gmx.de> <87tv5fs6kf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="125017"; 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: =?UTF-8?Q?Felici=C3=A1n_?= =?UTF-8?Q?N=C3=A9meth?= , 34343@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 02 02:23:16 2020 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 1impCj-000WJ6-Th for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jan 2020 02:23:14 +0100 Original-Received: from localhost ([::1]:35312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1impCi-0004xn-10 for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jan 2020 20:23:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1impCc-0004xZ-7n for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2020 20:23:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1impCY-0002QH-Ch for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2020 20:23:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1impCY-0002Q2-6m for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2020 20:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1impCY-0006eM-1x for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2020 20:23: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, 02 Jan 2020 01:23:02 +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.157792814725499 (code B ref 34343); Thu, 02 Jan 2020 01:23:02 +0000 Original-Received: (at 34343) by debbugs.gnu.org; 2 Jan 2020 01:22:27 +0000 Original-Received: from localhost ([127.0.0.1]:37869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1impBy-0006dD-On for submit@debbugs.gnu.org; Wed, 01 Jan 2020 20:22:26 -0500 Original-Received: from mail-lj1-f178.google.com ([209.85.208.178]:41227) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1impBw-0006cz-MC for 34343@debbugs.gnu.org; Wed, 01 Jan 2020 20:22:25 -0500 Original-Received: by mail-lj1-f178.google.com with SMTP id h23so39296276ljc.8 for <34343@debbugs.gnu.org>; Wed, 01 Jan 2020 17:22:24 -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=bDLVPDqomC/OH4fD0hFa7x5H0RAKzl72bO9roS7AqaA=; b=cP0/eyokmKItSFgBKj66TKTWOUwsn4J365ci6jBj/gNoFsAdKnCojw1fguLUcHPy31 El5dWQi5VS7dj2lLCod0pY4p6n4SgO4WYNybisGH5dZmi/Gw0lRIiunr4z+/a4AVQ44N qbKIR8IwjNSsaPg0VmrqA5qRSr3HvE0gkhOD8rDDlsKNaCaSXWWcVtys+83cv05NfEjD AuQNFA7U1Jp5yyqyRbLtG/7yP9L0ZOYxrj+vERc/KRybtNGw5JwNUtP/6RDVxW84PHKd mWtXH2zEpGj/XTyPfekEa1xYKFMHy1pZ216l3gwQuqEBt7WpbZeB38kiQgl96xexkN/y 40Xw== 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=bDLVPDqomC/OH4fD0hFa7x5H0RAKzl72bO9roS7AqaA=; b=SwGtszIcNEpK2EiYGUKRIF7DAEjeNUznfbBEqSna3DPZVM1ofPdqmOGhItpeDxc/87 1rirECy40s+edKq20cV44XjKJw59Gd0ds0LZs7LrHbR3NwLvk6t7wrQbPIu0IeYGRua5 qSpaofSOOFjZFdliseWPW/J7DOPuMGLxRcWrziayc4NoQeyvog/wjkRk3FeNiUvR2f8i 70XCPYsIozM0rkoBHQbQhANreYeroEOJo3J3XEZR6UHtUl+JJa4xkjQjKKMOz/EsonGV JwKj2nmAMj5oQCkhB3NYcG8fmyBfuB2uL4p4Z7r4ldd1FmH+muK7j7cP4UdkOl6I+BuY Rq+Q== X-Gm-Message-State: APjAAAXMPOYllMG/YxWzkTUGmey4gR59Q/mckh8BEb9lFwL1rOAexhVW eM5spOcZoOhQWvFqyK73Jm+7JqKSVPk= X-Google-Smtp-Source: APXvYqw4ECQIBG0iyOS5gIswdTGybrHYjfbSAUIQKMjBzPyKF5GmWjumLqTYrmCtdb6hMafXin1Suw== X-Received: by 2002:a2e:88c4:: with SMTP id a4mr18781123ljk.174.1577928138316; Wed, 01 Jan 2020 17:22:18 -0800 (PST) Original-Received: from [192.168.1.142] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id f26sm21773398ljn.104.2020.01.01.17.22.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jan 2020 17:22:17 -0800 (PST) In-Reply-To: <87tv5fs6kf.fsf@gmx.de> 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:174056 Archived-At: Hi Michael, On 01.01.2020 14:29, Michael Albinus wrote: > I've played a little bit with this. Even if there is no remote file name > involved, file-local-name is slow due to the file-remote-p call and the > file name handler mechanery. See: This is unfortunate. But there's a bigger problem: file-local-name is even slower when the file name actually *is* remote. > Refactoring the code, and applying `file-local-name' just to the cases > where it is needed, shows an elapsed time similar to the initial one. If you take a look at xref-matches-in-files, you will find that is exactly what I did. But check this out: ELISP> (benchmark-run-compiled nil (dotimes (i 10000) (file-local-name (format "/tmp/%d" i)))) (0.01541569 0 0.0) ELISP> (benchmark-run-compiled nil (dotimes (_i 10000) (file-local-name (format "/ssh:abc@def.com:/")))) (3.229403787 28 1.9053286330000034) And that is for just 10'000 files, not for 1'000'000. And with longer file names, the process takes even longer (twice as long in my real-world example).