From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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 01:24:08 +0000 Message-ID: References: <877cnafv39.fsf@gmail.com> <9447dde3-b8e7-2ec0-9a9c-72c4cf9d12a8@gutov.dev> <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" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20354"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , Eli Zaretskii , Stefan Monnier , 47711@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 02:25:46 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 1r0XKE-00056p-CA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 02:25:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0XJu-0007kZ-Nf; Tue, 07 Nov 2023 20:25:26 -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 1r0XJs-0007ia-Po for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:25:24 -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 1r0XJs-000322-9D for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:25:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0XKU-0006lQ-7m for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 20:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Nov 2023 01:26: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.169940670725930 (code B ref 47711); Wed, 08 Nov 2023 01:26:02 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 8 Nov 2023 01:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:43792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0XJb-0006k9-4O for submit@debbugs.gnu.org; Tue, 07 Nov 2023 20:25:07 -0500 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:53651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0XJY-0006jb-VC for 47711@debbugs.gnu.org; Tue, 07 Nov 2023 20:25:05 -0500 Original-Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5094727fa67so8591916e87.3 for <47711@debbugs.gnu.org>; Tue, 07 Nov 2023 17:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699406661; x=1700011461; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G/BcXy810ekklJx2DDC5bwlSdzgjuo9A+9ppmw4SfgU=; b=dQASkWFqKfnk2efCuQU69iMjQRd+UlJFuKExyuukpA7SJBj8WhDu1jZr5jr7MxDizj Bbk/P8PN1Rz5pDLrmr1nJOQHBkldYe5mOgwOas8/Wkwv86KGmCJPV7fKADWiNwstpOAN bOGp6Qq15i8/4Jwf5JkaP88gwJYzh58tmSwZX/lnWDd0YPkofJHL66n0/HpuD/6V2zCI zmKango20rDhzwMmME20w3SBue/b1yBJ4VfHCYY3d4klh4QixXk/rCXFLRlAqMuoOHbn 3VPUU0KflIc4nm94iKdiyT5da9PhDQoNK5OyX6uqL7bUUv7N81dFPoGl0JAlWHjgYNGm cwhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699406661; x=1700011461; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G/BcXy810ekklJx2DDC5bwlSdzgjuo9A+9ppmw4SfgU=; b=SNTrdkzqTNstW5dWhgN/06GIwRR0P5+iFeacAc0uYhBSkyhgJegIl9upigVNAI+V5Y /auz7cASM6qfy/cMPdpx4VorgaE8JXEqIz8dNJpe4oaLx+WcDfBcx3UfTvTkgRkKND9E NPYpIM6MQlYsK9udZ92e1djb+TE9KFHGt/gAFW+w5ZPmKHPRTpEcLD1HNr+gbztE96lZ NrzgmUbw3GDZmqKZWByIqdt1/7jpSndHQ87U6f5g8UCFqO7OdjT5dzKGedyQ41jw1dY5 nKzkW9DOd+cE0GS8k8O5d0blb1IClAcN80iqrhN+qYHPFO5e4Ffak1Ioc6vbH1TCYYJV ewGA== X-Gm-Message-State: AOJu0YwH3SNxwc/o19Hgdh3NwCjkjjagllyYO9J3dH8ZtNdMZlCKztJN TZ4Pd9Z9/MkjUBy8d64bcpIV42YR10RBpM1i2Eg= X-Google-Smtp-Source: AGHT+IHsej96YUq+0Qhv3Jdt+kCUQcaPv3teu2wAbyjCW12B4LNulfImxkOGIp+W4cmqYxG5buit0pPssXh5RKFPvJg= X-Received: by 2002:a05:6512:1293:b0:503:38f2:6e1 with SMTP id u19-20020a056512129300b0050338f206e1mr240165lfs.5.1699406660344; Tue, 07 Nov 2023 17:24:20 -0800 (PST) In-Reply-To: <7d9704c0-6848-f8f1-5126-232175936ff0@gutov.dev> 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:273958 Archived-At: On Wed, Nov 8, 2023 at 1:06=E2=80=AFAM Dmitry Gutov wrot= e: > > On 07/11/2023 14:13, Jo=C3=A3o T=C3=A1vora 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. Anyway, it _felt_ snappier, but maybe I was dreaming. Got any better suggestions for places where to place `benchmark-progn`? 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. > But speaking of the case when the *Completions* buffer isn't shown yet, > the code calls something similar to completion-try-completion, which > ultimately goes through completion-pcm--find-all-completions. Does it > currently apply faces too (in the default, non-lazy scenario)? No idea. just looking to optimize low-hanging fruit I can find. If you can find more, go ahead. Jo=C3=A3o