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#47711: bug#48841: bug#47711: bug#48841: bug#47711: [PATCH VERSION 2] Add new `completion-filter-completions` API and deferred highlighting Date: Wed, 8 Nov 2023 03:47:34 +0200 Message-ID: <1128a36f-1616-b9b0-1a4b-36501bdcfa2a@gutov.dev> References: <7d14bc13-4419-816c-5708-c42988c39c02@gutov.dev> <5d0a78cc-4fa0-ef04-3462-1826f17d7d56@gutov.dev> <877cn8asud.fsf@gmail.com> <8734xtauqj.fsf@gmail.com> <5181f95e-61e7-c8c4-6389-44ee57e0c749@gutov.dev> <31cadbfd-d086-a04f-0ed9-17ce70b4282c@gutov.dev> <7d9704c0-6848-f8f1-5126-232175936ff0@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12373"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Daniel Mendler , Eli Zaretskii , Stefan Monnier , 47711@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 02:48:49 2023 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 1r0XgV-0002xR-Eo for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 02:48:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0XgC-0006mi-Nm; Tue, 07 Nov 2023 20:48:28 -0500 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 1r0Xg9-0006mK-AL for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:48:25 -0500 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 1r0Xg8-0006gL-86 for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:48:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0Xgk-0007OE-7T for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:49: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: Wed, 08 Nov 2023 01:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47711 X-GNU-PR-Package: emacs Original-Received: via spool by 47711-submit@debbugs.gnu.org id=B47711.169940810528191 (code B ref 47711); Wed, 08 Nov 2023 01:49:02 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 8 Nov 2023 01:48:25 +0000 Original-Received: from localhost ([127.0.0.1]:43798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Xg8-0007Kb-Da for submit@debbugs.gnu.org; Tue, 07 Nov 2023 20:48:24 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:48205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0Xg6-0007Jq-Oq for 47711@debbugs.gnu.org; Tue, 07 Nov 2023 20:48:23 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E9C655C0238; Tue, 7 Nov 2023 20:47:38 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 07 Nov 2023 20:47:38 -0500 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:sender:subject:subject:to:to; s=fm2; t= 1699408058; x=1699494458; bh=fjKV4cUtOoGb0d4MHc1/oL/lhKjnXNdQEL9 dBbzsWKE=; b=pnWgOvmNoDsDVJ/5Uot6pYjYAHZEu3TJVKoEEZRQccZZux8jRu8 E4Kb9SvkQgYkhsEw09FxxLVWo3qjZJxLeL1NlOmYbEXuoepQjMI9auJYXQSdHl/A G7hbj3QpKIXmcTZmgqpIrKoTkOD5xv4X2+OuTLXZ97iNZrwpqVXBA06mAp6rI0cf 7lxdeMvJHDxxgm8+mijBKVt63n1599Lf5DFjrHssbNTyi1gcZCKuqwFVaDnPwgtv 1O0UeJzvSL5bhkTy4tkvTrkLB9LWGkDxJuTThIc5dIbUoqdKvMh/ar0I3pb74hXQ ad2xOOpLjtux37uRzP9J0pqYtHyZjTriN+Q== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699408058; x=1699494458; bh=fjKV4cUtOoGb0d4MHc1/oL/lhKjnXNdQEL9 dBbzsWKE=; b=FcTp9Nj/PXDMvaI1w4DBUiYqholJ1kr5ZACQIRRk9QDulVFklsp y3Yp7ai9CjCFlmn0W74rWs1Q8eAOPMeDo0InvCVeBF1kDkh+Tyn35v3agnxVfVX6 /6ItsnY+DeEyaKxNJ36jEYSidFaNPN+fGkkng6OyugeqVdsLOEOxeI3uZZbTWj60 5ppla2MSGE8EGhj9zaSfPjcQaS26sVnM/496loutSWVlY1P0htxzQ1eGHc1Xp33F F/ezTk0oea1gWbIEmjKEAcYW47PB2s1wSWuoQvhZBtr1zlrSxYR5ThLiNecY3tvZ Un2kjFh2OJKbacNaykwuFWQJ7XcaA6ofwrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddukedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Nov 2023 20:47:36 -0500 (EST) 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:273959 Archived-At: On 08/11/2023 03:24, João Távora wrote: > On Wed, Nov 8, 2023 at 1:06 AM Dmitry Gutov wrote: >> >> On 07/11/2023 14:13, João Távora wrote: >>> Any objections? Seems to speed it up when flex is the preferred >>> completion style outside icomplete. These are average times >>> collected from the instrumentation of the above >>> completion-all-completions when doing a M-: (setq i TAB) >>> >>> I just used my normal Emacs session for this. >>> >>> with lazy hilit: 0.104536125 >>> without lazy hilit: 0.172522571 >> >> IIUC the problem with the default completion-at-point UI here is that is >> prints all completions anyway, in the buffer *Completions*. And so it >> applies syntax highlighting to them as well, and does that eagerly (as >> opposed to e.g. doing that via jit-lock). >> >> If you instrumented only the 'completion-all-completions' call, then >> that might miss the subsequent time spent in sorting. > > You probably mean highlighting: that's the saving being made here, > not sorting. I meant both but I forgot that we moved scoring to later in both cases. > Anyway, it _felt_ snappier, but maybe I was dreaming. Got any > better suggestions for places where to place `benchmark-progn`? Perhaps around the whole minibuffer-completion-help. > Also, I don't think *Completions* has _every_ matching completion, > does it? Doesn't it display more completions as you keep TABing? > That's what I supposed was providing the speedup. Well, I type (d, press C-M-i, then select the window showing *Completions* and scroll to the end of the buffer. The last completion displayed there starts with "dy", so that's probably all of them. That's with the default completion-styles config, but with flex it's the same: all completions shown in the buffer. Sorted and highlighted.