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: [PATCH VERSION 2] Add new `completion-filter-completions` API and deferred highlighting Date: Sun, 15 Aug 2021 01:03:18 +0100 Message-ID: <87tujr7ewp.fsf@gmail.com> References: <3d3f894f-a6fa-53ae-5d50-c3aa9bffc73e@daniel-mendler.de> <56ab18b1-4348-9b2c-85bb-af9b76cd429a@daniel-mendler.de> <38a06f3c-4a7a-755c-c99b-708f91afabfa@daniel-mendler.de> <9f59f87c-2489-aaa0-5b3f-0e911b7ffa6c@daniel-mendler.de> <83im08bjc3.fsf@gnu.org> <877dgo8ihf.fsf@gmail.com> 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="17951"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Daniel Mendler , 47711@debbugs.gnu.org, monnier@iro.umontreal.ca, 48841@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 15 02:04:29 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 1mF3dd-0004Wj-05 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Aug 2021 02:04:29 +0200 Original-Received: from localhost ([::1]:60526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mF3db-0008IP-EZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 20:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mF3dC-0008Fz-Pr for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 20:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mF3dC-000690-3x for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 20:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mF3dB-0006LO-TJ for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 20:04:01 -0400 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: Sun, 15 Aug 2021 00:04:01 +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.162898580924333 (code B ref 47711); Sun, 15 Aug 2021 00:04:01 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 15 Aug 2021 00:03:29 +0000 Original-Received: from localhost ([127.0.0.1]:45532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF3cf-0006KK-5O for submit@debbugs.gnu.org; Sat, 14 Aug 2021 20:03:29 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:35501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF3cd-0006K3-D0; Sat, 14 Aug 2021 20:03:27 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id q10so18386833wro.2; Sat, 14 Aug 2021 17:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=qklDJ5gPDaNiJGUeObEycQTArsmErnSMftxyioCEZWM=; b=PkFu5fYdl2NYm+8n3UE2+ICJducbUpqKse/nlXI8HXlbJGdqcCRbcquZlGnn6X5QcT e7XtwTnz1Sq1PASmhDX01c7fHkacEXNzA0HFMdRp8ZxoJetF/K392SngIsF+bJeP6r6m 1xR8DQbrgYmBKYfgWiao1ra/iJYqjd4ah4SD8+0S4u7nXOuMiDEjrzzFY5/Tbv0AI6Ez xXkD8Nr/JPcWKTOq9XvBepPEts5F6Qm1j0wTkfpamcUX5IPZBjoPumdwtw9YoEoRtae9 oN2MIGqCxj5PYezGZJQvKeFXxcron1zG+pGHh+CcTcQmOQqmW4ABGxeSfg4YKm3tT6PS EE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=qklDJ5gPDaNiJGUeObEycQTArsmErnSMftxyioCEZWM=; b=VXdJWx8IWM31cFiVoetwVhjgcgy5w+4V3qiX0sPb7iHvAgDorxQPewjVrF006QoCMl 11pLQq0thVvSLgSKVPIEeTFKjV8D9SxsR15fOrFBNlNpffhEimRe0BjshZPTEgh5tnqa oEW7elD1CeUGjmlnc3JW8f/CnmqeMqBC956RKI3SDZcsVKrlplbgIjLPgkmF0cjdhBTZ pIPEy7IZc79CvRSpc5E1NjryF+SUirnesXy/Jq9rT2xFAhLuKraJFK/lOkQ0tKIQr+Rj TAGcq2w6qs4EL6HaW189LRZxc5PDxLGBQdRQF92/6rta6BPFbObeFGGvgA9sZ+lZYeXb OqdA== X-Gm-Message-State: AOAM531YwnxOY6+u54svB3iSQvSON3xlihLMnL+lRdrT2vEKLKKWS5hB RcKqe5mqGBrck55u9wXvMt0= X-Google-Smtp-Source: ABdhPJyUCZaxxxOBi9K8i35OHATog1u0JejE8y4B2qRfotNjDgBltcumqscOgQDXq2Tgy/t0KO4vRQ== X-Received: by 2002:a5d:5703:: with SMTP id a3mr10510017wrv.333.1628985801441; Sat, 14 Aug 2021 17:03:21 -0700 (PDT) Original-Received: from krug (a94-133-27-132.cpe.netcabo.pt. [94.133.27.132]) by smtp.gmail.com with ESMTPSA id s10sm7598232wrv.54.2021.08.14.17.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Aug 2021 17:03:20 -0700 (PDT) In-Reply-To: <877dgo8ihf.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 14 Aug 2021 10:48:28 +0100") 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:211859 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > in the absence of any controlled benchmarks I did some of > my own, using the most controlled environment I could devise. I start > Emacs like so: > > ~/Source/Emacs/emacs/src/emacs -Q -f fido-mode -f fido-vertical-mode -= l ~/tmp/benchmark.el ~/tmp/benchmark.el I have know tweaked the benchmark slightly to make it easier to evaluate speed qualitatively. Here's what I've been using. (require 'cl-lib) =20=20=20=20 (fido-mode 1) (fido-vertical-mode 1) =20=20=20=20 ;; Introduce 150 000 new functions to really slow things down. ;; Probably more than most non-Spacemancs people will have :-) (defmacro lotsoffunctions () `(progn ,@(cl-loop repeat 150000 collect `(defun ,(intern (symbol-name (gensym "heyhey")))= () 42)))) =20=20=20=20 (lotsoffunctions) =20=20=20=20 (when nil ;; Press C-u C-x C-e C-m quickly to produce a quantitative sample (benchmark-run (completing-read "" obarray)) =20=20=20=20 ;; Or just press C-h f to experience how fast/slow completion is. ) The results are the same as the ones I reported in the previous email. I've also cleaned up my previous patch of the scratch/icomplete-lazy-highlight-attempt-2 branch slightly. It is now fully opt-in for frontends and completion-styles, so the backward compatibility problems which I speculated seem to have been exaggerated. I'm still studying it for flaws, but anyone can have a look. And, of course, there are many different ways to realize the "opt-in" for frontends/styles. I just chose the one that seemed the simplest given the current completion framework. The performance is still very good, it reduces the usual waiting time in long lists of completions to about half of what it currently is. Jo=C3=A3o