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: Fri, 27 Oct 2023 02:35:33 +0300 Message-ID: <785a64d1-80cd-571f-126b-594ba69f2e56@gutov.dev> References: <3d3f894f-a6fa-53ae-5d50-c3aa9bffc73e@daniel-mendler.de> <56ab18b1-4348-9b2c-85bb-af9b76cd429a@daniel-mendler.de> <328f87eb-6474-1442-e1ca-9ae8deb2a84a@yandex.ru> <83fsvcbio7.fsf@gnu.org> <9f432d18-e70f-54c1-0173-1899fb66d176@gutov.dev> <877cnafv39.fsf@gmail.com> <8734xy73n7.fsf@gmail.com> <87zg05awbw.fsf@gmail.com> <2703531c-333f-c4a1-837b-c151ef3fd57d@gutov.dev> <87v8atarsf.fsf@gmail.com> 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="21257"; 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 Fri Oct 27 01:36:51 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 1qw9uE-0005KR-26 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Oct 2023 01:36:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qw9tw-0006Cu-VH; Thu, 26 Oct 2023 19:36:32 -0400 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 1qw9tv-0006Cg-Bx for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 19:36:31 -0400 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 1qw9tv-0004rV-3e for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 19:36:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qw9uP-0001zv-Mw for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 19:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Oct 2023 23:37: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.16983633817614 (code B ref 47711); Thu, 26 Oct 2023 23:37:01 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 26 Oct 2023 23:36:21 +0000 Original-Received: from localhost ([127.0.0.1]:34688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qw9tk-0001yj-W2 for submit@debbugs.gnu.org; Thu, 26 Oct 2023 19:36:21 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:34251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qw9te-0001yQ-6u for 47711@debbugs.gnu.org; Thu, 26 Oct 2023 19:36:18 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2C05332016EF; Thu, 26 Oct 2023 19:35:37 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 26 Oct 2023 19:35:37 -0400 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= 1698363336; x=1698449736; bh=bKE1bd2AyVhq9ECl/+D3H3r2cgqPajzlth/ O+3vmxfM=; b=SiBXOFLlMNefOdv/a5ddNZHXEGUK45nYlegHKYwRoz2SBDhz6xc oWmxFnXcRyv0xQL1cliG5BtwLvINha0Z/4+Vl8EEcuympB5AUNixdCHnnD427xn8 /fzjPXw7Apyx8zj4XdS9jloWpSwXsEapBDLngKehYfODIHKhsxuj62WXbLf/tEx0 zKB40blbHVtM8EZM8/z6WZYTQGWcUgKFearBUPmpND/sqmsZWouNgub2T3WugIf4 Hd2M3Zu2EU6rHV9AVwmb5BUMzi1EQfpn0IU4bry6VVav8DPH88nzskb7hJtLy8Rr h84QS0Idn6XnxKqhu6JkrQSHycD/JSZc70w== 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= 1698363336; x=1698449736; bh=bKE1bd2AyVhq9ECl/+D3H3r2cgqPajzlth/ O+3vmxfM=; b=G2XoutyjL9Xl6JT52HFay051LkqmX9wQvNgsRK+8XlRFNMn7vMv 8qolfe2/VDDWQZTQV+1wxMyFhgtG7KmRgpPuj68PkBNHBswIgDgQP/mV6g/QJrBi 47PB2WbtogKzwBiB1x2RDXUQ2Yr/513OVvK6YX2Qx7PL01zFM/jPCxch/Wh1i5wV 5LIKQ1lc7uZ4W4y/OJ4IVc34dWY18LOa2esPh+uIm9dvxmnXTtJAV2OaPIbOU9V3 xso2BbRQEaSPgwWTm3C2pF+Xr4Pu+mRQ19NO2sVULvz0s2zsiHy9AZaUVIdA74Lo Wfk6QTJxo+Vo/kPYoFL0xPpucrG5HdHn0Iw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleefgddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefhffehleejffegffeugefhkeektdffgfehjedvgeejtedtudehueffgffgfeej heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Oct 2023 19:35:35 -0400 (EDT) Content-Language: en-US In-Reply-To: <87v8atarsf.fsf@gmail.com> 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:273325 Archived-At: On 27/10/2023 02:27, João Távora wrote: > Dmitry Gutov writes: > >> My understanding is it's due to the judicious call (copy-sequence >> orig) that you added before 'put-text-property' is called. While it >> seems like a good idea to preserve the original value, when almost all >> of obarray matches the current input (which is the current scenario), >> a lot of strings will be copied. > You're right, I reproduced the regression. I thought I had taken out > the copy-sequence, but forgot it there. In an earlier stage I suspected > that I needed the copy, but I don't think I do. Please try this new > patch that removes it. I've also pushed it to the > feature/completion-lazy-hilit branch. Yep, without copy-sequence the regression is gone. Now the input strings are routinely mutated, though. ;-( You could do a copy a little later -- after the match succeeds and the score is computed. But for short widely-matching inputs like 'a' that would make little difference. I also experimented with hash-tables for "external" score storage. But it still comes out a little slower than either of the proposed solutions.