From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#50906: xref-find-references blocks Emacs: asynchronous operation? Date: Tue, 05 Oct 2021 20:09:43 +0200 Message-ID: References: <152761c7-d793-2fa5-430f-d018c4957f89@yandex.ru> <6f2c07d4-3e29-44c0-bb7f-c37905b3e12b@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8827"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 50906@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 05 20:19:57 2021 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 1mXp2j-00028d-Oj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 20:19:57 +0200 Original-Received: from localhost ([::1]:47532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXp2i-0006Nt-NO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 14:19:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXot8-0003CY-AY for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXot8-0005bb-17 for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXot7-0006Qu-Lg for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Oct 2021 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50906 X-GNU-PR-Package: emacs Original-Received: via spool by 50906-submit@debbugs.gnu.org id=B50906.163345739324705 (code B ref 50906); Tue, 05 Oct 2021 18:10:01 +0000 Original-Received: (at 50906) by debbugs.gnu.org; 5 Oct 2021 18:09:53 +0000 Original-Received: from localhost ([127.0.0.1]:41877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXosy-0006QO-Qn for submit@debbugs.gnu.org; Tue, 05 Oct 2021 14:09:53 -0400 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:35786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXosx-0006QA-4V for 50906@debbugs.gnu.org; Tue, 05 Oct 2021 14:09:52 -0400 Original-Received: by mail-ed1-f51.google.com with SMTP id b8so115354edk.2 for <50906@debbugs.gnu.org>; Tue, 05 Oct 2021 11:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=B+d5spbBhOU7kmz3I5xB31ooRO/ti35Bk4tuPufjCHI=; b=ipxo0IHQ6zsOSCOn2hVNmPN/UNBsDHVYtjk8mIwfWWXjFgWcQ7fTiFuI4Ev5tIYKdr GkqHPzc19JwAgxxhD9omKKLVeV8L1TI3K7SDK17xQMgNpo9Ft5hC4YW34DdC27R9usuN 6dWQb8FfqEzJNdcNR7bkQ1mW/n2LRM+Rsnnv3S4dpBCWop1zUehQahpPzIg0Sgu6mgO9 EY/rP8pzId7Ddenj5RBV7OaXM1UpWralNFdzWjKGX1PqwcdAXQRZIsrpFmXfNFPaTUnS aq4eDsJT7i8zUAvYZivmDIdTF5BjNpOvkLq7CRSbv4qeiSfH/qoOLBPB4nAHbmqFABAv dn4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=B+d5spbBhOU7kmz3I5xB31ooRO/ti35Bk4tuPufjCHI=; b=0oUqtWd3H5KuAyppa18baAZKd2rUgBGq0aX+yHUyO87MfcRbIe7E/ECmdij1tF0nPh N6HP03mGBblu0Hht7/XJ1Y8jCGP9EtzTUjLh2cu8rmT9SshwtVi7Q6vAVPKlQKnKrm2U 2HYL3Uy+jWlnCBhVtQK7Rl6ZO9yntOZWbjThQTaziorDGvb38Vs9aYWd/PmpwWvuG40R inYHQvW2v+X20Ia2OjvaENmSF+pNEoXikQvbah3meTayl6yZEF1bXeua+utkvuDRewIP 6nqsL2xjRw4YaA5Gs8l8AbNlxe0yqcc1TG1C+D7INFghHuI3zK5zSzzem2WWjDZm7LuL enFA== X-Gm-Message-State: AOAM530Lxr6/hzOxWbfy5pN9STFxiYuvnngMXMzRcYuI1W0pvPzz0hDQ OBFDxxKaRrhJ+Dz0P6viV2Qc4zXJZxE= X-Google-Smtp-Source: ABdhPJy2goXpcOVyv/E+RTSji7r5AYq2mr6NwkhPo5aVkwwjmBaodHO6OovoKwIiNRBK7jeOl0UmrA== X-Received: by 2002:a17:907:2bec:: with SMTP id gv44mr15672020ejc.523.1633457385245; Tue, 05 Oct 2021 11:09:45 -0700 (PDT) Original-Received: from caladan (dial-185031.pool.broadband44.net. [212.46.185.31]) by smtp.gmail.com with ESMTPSA id ca4sm8095957ejb.1.2021.10.05.11.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 11:09:44 -0700 (PDT) In-Reply-To: <6f2c07d4-3e29-44c0-bb7f-c37905b3e12b@yandex.ru> (Dmitry Gutov's message of "Tue, 5 Oct 2021 19:38:36 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:216484 Archived-At: On Tue, Oct 05 2021, Dmitry Gutov wrote: > A really fast searcher solves the biggest part of the problem, but > we'd still be left with very imprecise searches (many matches) locking > up Emacs for seconds, since the Lisp overhead processing a match is > unavoidably larger than the time it takes for a search program to > print it. Using lazy sequences could allow us some leeway as well -- > namely, processing only the first N hits initially, and then > processing the rest only if the user requests that. > > If we only target this kind of improvement, the "abort" functionality > could wait. Yes, limiting the time that Emacs is locked up, by limiting the number of hits that Emacs accepts in one chunk, seems like the way to go. > We'd still need to choose between sorting the results and > saving on parsing the output buffer eagerly, though. Theoretically it should be possible to sort the first chunk and display it. Then, when the next chunk arrives, merge it in, =C3=A0 la heap-sort, a= nd update the display accordingly. Probably not worth the effort, though. Also, I think that the only "sorting" that we actually do, is grouping by filename. And that doesn't seem all that important to me. Helmut