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#48841: bug#47711: bug#48841: bug#47711: [PATCH VERSION 2] Add new `completion-filter-completions` API and deferred highlighting Date: Mon, 16 Aug 2021 19:25:00 +0100 Message-ID: <87tujpgscj.fsf@gmail.com> References: <8a36e61a-1c5b-bf3b-a454-077348589c4f@yandex.ru> <87y29471ov.fsf@gmail.com> <837dgob6yo.fsf@gnu.org> <87wnootec0.fsf@gnus.org> <5d70b0ad-3838-ddb8-d341-9a5531d9da73@yandex.ru> <0cbf224b-b382-8a02-3f06-9f6d7e5e9741@yandex.ru> <87a6lihv7b.fsf@gmail.com> <63e03b18-db81-3b11-c692-0af9df20c506@daniel-mendler.de> <83k0kl8sxm.fsf@gnu.org> <83bl5x8r02.fsf@gnu.org> <77e98cdf-427d-ec7a-7a49-04dcd65d6a94@yandex.ru> <8735r9ii8b.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="33344"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Daniel Mendler , monnier@iro.umontreal.ca, 48841@debbugs.gnu.org, larsi@gnus.org, 47711@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 16 20:26:12 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 1mFhJM-0008U1-PX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Aug 2021 20:26:12 +0200 Original-Received: from localhost ([::1]:53676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFhJL-0006zM-Le for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Aug 2021 14:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFhJD-0006tC-Dx for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 14:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFhJD-0003fo-73 for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 14:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mFhJC-0003AW-Qz for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 14:26:02 -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: Mon, 16 Aug 2021 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48841 X-GNU-PR-Package: emacs Original-Received: via spool by 48841-submit@debbugs.gnu.org id=B48841.162913831412089 (code B ref 48841); Mon, 16 Aug 2021 18:26:02 +0000 Original-Received: (at 48841) by debbugs.gnu.org; 16 Aug 2021 18:25:14 +0000 Original-Received: from localhost ([127.0.0.1]:50954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFhIQ-00038q-2Q for submit@debbugs.gnu.org; Mon, 16 Aug 2021 14:25:14 -0400 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:37427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFhIM-00038Q-8B; Mon, 16 Aug 2021 14:25:12 -0400 Original-Received: by mail-wm1-f41.google.com with SMTP id c8-20020a7bc008000000b002e6e462e95fso68660wmb.2; Mon, 16 Aug 2021 11:25:10 -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=0BE4nTI0Dd3MVVLlpx1zJYGASsxUaJ4h6dDPWSlxDks=; b=IUmVH58Wlk5LXcC7cOXNmJmBG8dmNuqlPDZDNXrb+qTVGauEVYjXkZImXdgiJL4KWE WHaYKI2Z+vTXqNJxkfUWTtG6nnCvBJC357wpzaGEZ59xSx7BZymfQeA7++XLZWWlpeJg LbQLYABh53mNKF/tCToo9ge8uy1nySfm4wnBVu7ukyUKohwo4VW9iZC+KAWMUM9xpdEA vMAkUKO50+v5RKMzQdZ/EXbKyXjuloHyOuwYklBKyOacwG01+bad3Up6/i8Dgpw5aIh0 weD+G00ytsT+si218pf8/pLqhG6to9DpOI5BK3B7fa+1D74zTzgmkdlj2m+xvqjJsuZL mitA== 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=0BE4nTI0Dd3MVVLlpx1zJYGASsxUaJ4h6dDPWSlxDks=; b=LvNE67S4Pcz85buMgpdiTpsZBEThwMzWe/yu485N7UKBJzqTSUYpVNRpnSfBePwkWP pNWTEcgJ6MAh3376FFF2cIhLQ/jqYPCPj1Ks7eYyrH/B6QXZ+gPThiYFtlQ44dyzvJl9 Kn6s4JRpQKtAx9+ZewUv4+i02dSG+y1WedW1T6I5vkfQdt3OVxWmF/rGqC79ZrEcGR8m kJzx2kdqMIFDZ7kG8nheAgoV2kyoShp9HxMpelgXc2qZXhqvPA16mv7GYrTUF2D7qSal c1+HO3I8kjEaL35drnEg8sQCNVBspd44I3uK3gIp5Vua/gdK/pd+Uqo1SOtDbnWX2jOu LU1A== X-Gm-Message-State: AOAM530pJDiUpoVbdHDxTxieLeY2xHGUJ30cN5FKwG43xZVuGCEXxsp9 6t4X9LcvBdwFbL7YQmXUSYvZIKVJuNw= X-Google-Smtp-Source: ABdhPJyz1SX1npNmBM2hABJYxBnaAgGjAVWLvcpPufKvVmqnEmz12swhsQMV5sSQsQXecsNZq3YGkw== X-Received: by 2002:a05:600c:3b91:: with SMTP id n17mr413535wms.72.1629138303918; Mon, 16 Aug 2021 11:25:03 -0700 (PDT) Original-Received: from krug (a94-133-27-132.cpe.netcabo.pt. [94.133.27.132]) by smtp.gmail.com with ESMTPSA id i3sm286343wmb.17.2021.08.16.11.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 11:25:03 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Mon, 16 Aug 2021 17:33:20 +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:212055 Archived-At: Dmitry Gutov writes: >> prepared a version of my patch that is based on weak-keyed hash tables. >> Slightly slower, but not much. Here are the usual benchmarks: > > Cool, I'll take a look, thanks. I've made it faster, now very close to the string-propertizing approach, itself very close to the theoretical best (which is no copy, no highlight). See the tip of the scratch/icomplete-lazy-highlight-no-string-props branch, which I had to rewrite (some Git flub-up). All benchmarks after sig. Jo=C3=A3o (require 'cl-lib) ;; Introduce 300 000 new symbols to slow things down. Probably more ;; than most non-Spacemancs people will have :-) ;; (setq ido-enable-flex-matching t) ;; (ido-mode) ;; (ignore-errors (ido-ubiquitous-mode)) ;; (fido-mode) ;; (fido-vertical-mode) ;; (vertico-mode) ;; (hash-table-keys completion--get-lazy-highlight-cache) (defmacro heyhey () `(progn ,@(cl-loop repeat 300000 collect `(defun ,(intern (symbol-name (gensym "heyhey"))) () 42)))) ;; (setq completion-styles '(substring)) (setq completion-styles '(flex)) (heyhey) (setq icomplete-show-matches-on-no-input t) (symbol-name 'mouse-kill) (when nil ;; Press C-u C-x C-e C-m quickly to produce a sample. Always discard ;; the first sample in the session, it tends to have an extra GC and be ;; slower. (benchmark-run (completing-read "" obarray)) ;; don't use string props (2.848873438 6 0.8307729419999994) (2.848416202 6 0.8370667889999996) (2.786944063 6 0.8230433460000004) (2.7815761840000004 6 0.819654023) (2.6929080819999998 5 0.7036257240000001) ;; string props (2.630354852 4 0.7071441910000011) (2.594761891 4 0.7082679669999994) (2.589480755 4 0.7112978109999997) (2.661196709 4 0.7130021060000011) (2.844372962 4 0.7378870879999999) ;; master (3.6339847759999997 12 1.601142523) (3.757091055 12 1.6231055449999996) (3.785980977 12 1.6333413839999995) (3.716144927 12 1.6100998260000008) (3.808275042 11 1.611891043) ;; these next two are not comparable to the above, because in ;; ab23fa4eb22f6557414724769958a63f1c59b49a I added sorting to flex ;; which changes results, and Daniel's patch no longer applies ;; cleanly. ;; daniel's patch (3.420418068 10 1.451012855) (3.603226896 10 1.672325507) (3.501318685 10 1.6150095739999992) (3.659821971 10 1.6580361760000004) (3.624743674 10 1.657498823) ;; master just before daniel's patch (254dc6ab4c) (2.611424665 10 1.5267066549999981) (2.48811409 10 1.486639387000002) (2.472587389 10 1.479865191) (2.543277273 10 1.510667634999999) (2.546243312 10 1.4986345790000009) =20=20 )