From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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: Sat, 14 Aug 2021 10:16:08 +0300 Message-ID: <83fsvcbio7.fsf@gnu.org> References: <3d3f894f-a6fa-53ae-5d50-c3aa9bffc73e@daniel-mendler.de> <56ab18b1-4348-9b2c-85bb-af9b76cd429a@daniel-mendler.de> <328f87eb-6474-1442-e1ca-9ae8deb2a84a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11932"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, monnier@iro.umontreal.ca, joaotavora@gmail.com, 48841@debbugs.gnu.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 Sat Aug 14 09:17:09 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 1mEnun-0002uE-Dt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 09:17:09 +0200 Original-Received: from localhost ([::1]:39878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEnum-0004Zi-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 03:17:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEnug-0004ZL-Jh for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 03:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEnug-0002RM-Cg for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 03:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEnug-0003ev-8X for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 03:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Aug 2021 07:17: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.162892538714006 (code B ref 48841); Sat, 14 Aug 2021 07:17:02 +0000 Original-Received: (at 48841) by debbugs.gnu.org; 14 Aug 2021 07:16:27 +0000 Original-Received: from localhost ([127.0.0.1]:43480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEnu6-0003dl-QD for submit@debbugs.gnu.org; Sat, 14 Aug 2021 03:16:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEnu4-0003dS-7x; Sat, 14 Aug 2021 03:16:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44022) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEntz-0001rd-33; Sat, 14 Aug 2021 03:16:19 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2898 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEnty-0006r5-Iw; Sat, 14 Aug 2021 03:16:18 -0400 In-Reply-To: <328f87eb-6474-1442-e1ca-9ae8deb2a84a@yandex.ru> (message from Dmitry Gutov on Sat, 14 Aug 2021 05:55:17 +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:211809 Archived-At: > From: Dmitry Gutov > Date: Sat, 14 Aug 2021 05:55:17 +0300 > Cc: Stefan Monnier , 48841@debbugs.gnu.org, > 47711@debbugs.gnu.org > > On 13.08.2021 15:05, João Távora wrote: > > If one removes these lines, the process becomes much faster, but there is a > > problem with highlighting. My idea is indeed to defer highlighting by not > > setting the 'face property directly on that shared string, but some > > other property > > that is read later from the shared string by compliant frontents. > > I haven't done any direct benchmarking, but I'm pretty sure that this > approach cannot, by definition, be as fast as the non-mutating one. Daniel seems to think otherwise, AFAIU. > Because you go through the whole list and mutate all of its elements, > you have to perform a certain bit of work W x N times, where N is the > size of the whole list. > > Whereas the deferred-mutation approach will only have to do its bit > (which is likely more work, like, WWW) only 20 times, or 100 times, or > however many completions are displayed. And this is usually negligible. > > However big the difference is going to be, I can't say in advance, of > course, or whether it's going to be shadowed by some other performance > costs. But the non-mutating approach should have the best optimization > potential when the list is long. So I guess the suggestion to have a benchmark is still useful, because the estimations of which approach has better performance vary between you three. So maybe producing such benchmarks would be a good step?