From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness Date: Mon, 18 Mar 2019 14:51:50 +0000 Message-ID: References: <20190213212413.868.40960@vcs0.savannah.gnu.org> <20190213212415.148B9209D7@vcs0.savannah.gnu.org> <0ba3ca47-c7d6-a608-536e-94784ba3384b@yandex.ru> <4f4e9ccd-b152-2b37-cad2-6c96b0a64d84@yandex.ru> <646c8d35-89a7-b12f-8a78-b05e6d8f781c@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="32188"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 18 15:53:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5tdX-0008Gz-Bs for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 15:53:11 +0100 Original-Received: from localhost ([127.0.0.1]:42857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5tdW-0004ZM-Ct for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 10:53:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5tcR-0004Tg-TH for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5tcR-0002Lw-14 for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:52:03 -0400 Original-Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:34005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5tcQ-0002LN-Ma for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:52:02 -0400 Original-Received: by mail-qk1-x735.google.com with SMTP id n6so9758080qkf.1 for ; Mon, 18 Mar 2019 07:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Bn/Og6zdoS+9oCN4fG2Dngp9tdhDQduDCTy6QPXmAi0=; b=G7ucPlbUeDtPdrNDzUZNnChLcfWiKh7gBTzYIYi8SCrgMP2JmnUIj4fYINrAB1ybGE nQDQM3L3X50HG9zA/m051IrypViZF5Tza/SFbEaE4NolI2Tamj6tdMa/YrK+pqkaRQGR AQjWU5AFboIevLxvC46O01PHVuT7iMVTy/OQz7QUS//hDZ898tw54kaHeIFucmpIX7aK NRxSEuUZRhZUEDoUUOYhcpFkzGrN4noIDS+XNn+AnFsRzxHgoSRf5vzujzPJcOjPgRRo OcEK1cFGqjC9rOTl318b4dyI+TO6ET9kFShccfJ/7p1CKdcvlSmvAM3uE+vF4ZU0ooWA obtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Bn/Og6zdoS+9oCN4fG2Dngp9tdhDQduDCTy6QPXmAi0=; b=madjSU71AdXLYRBycU5l9kfSdafjoPFNRjXqhgP6KISGd59NrZg/SiBwWw/H+tIy3d WEB+HTXPut7WIvCUWZ4PO021CwuBXjEZL/Vzn8tBLbMTfrPoxjX4/l32CTQOQh186pV/ 6iMXFIwUnoLubJBR0xmwppDMkLu1xgL2+KSoaKU9bhJWD+nOqTub4GoB7WhwXMBBSZjB yIer2FIu9X9xNn4kWenpXH6ItNpVmM7YyTECkO+CTxtOGT3xri5aoJchxdia+Oafs1TV qHxDdMONFuAe6oNFMe8cqsAFMJUrs0z+GR18YCc850WtpG2DEhburWKJl5Rq1zfjw1qe nVQw== X-Gm-Message-State: APjAAAWQw846gxe8tWclCYQdTvPAC/yd8y89zjXmwBgXt/seQBSV1CpC 1G9MDPzfcAC81x0NZFg/5blPGgyJyOewuZk3IoI= X-Google-Smtp-Source: APXvYqyc6oN2V7OA5ASyxdDzw8/faJ6lPvtZdalZZbDgwxQUYxP8I7H/b4vQ6IGOc105PWwbc/ROzjVhClnxP7Mtf/4= X-Received: by 2002:a37:8586:: with SMTP id h128mr13468618qkd.322.1552920721642; Mon, 18 Mar 2019 07:52:01 -0700 (PDT) In-Reply-To: <646c8d35-89a7-b12f-8a78-b05e6d8f781c@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::735 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234325 Archived-At: On Mon, Mar 18, 2019 at 2:27 PM Dmitry Gutov wrote: > On 17.03.2019 23:46, Jo=C3=A3o T=C3=A1vora wrote: > > >> Another thing I'd like to note: with flex completion, RET doesn't sele= ct > >> the current candidate anymore (working as intended, of course). But it= 's > >> a bit disorienting. > > > > In what situation exactly? Emacs -Q + (setq completion-styles '(flex)) = + what? > > + input is not a prefix match. E.g. M-x describe-variable, then input > 'compst'. RET won't select the completion. I must be missing something, because that doesn' work in vanilla Emacs -Q, either, i.e. M-x describe-variable + something + RET will only select "something" if it is completable to a sole candidate. Flex works th= e same way, though 'compst' will probably match more symbols than with basic completion (where it matches none). You might want to bind RET to "minibuffer-force-complete" or "minibuffer-force-complete-and-exit", but that's orthogonal I think. Or am I missing something? > Try a smaller input, like just 'k'. The difference is more stark in that > case, and the lists of completions are longer. > > For the same reason (lots of matches), I'm afraid simply moving matching > to C won't bring a noticeable improvement. You're partly right. With shorter input, the burden shifts considerably from completion-pcm--all-completions (the matching) to completion-pcm--hilit-commonality (the hilighting and scoring), but according to the CPU profiler, the former is still dominant, so even a modest improvement there could still have a large impact. Capping max matches (after sorting) might bring more improvements to parts of the code that I'm not profiling (like stuff that iterates all matches, though I'm not sure what), or by releasing large parts of the list early for the GC to reap. As can other techniques like deferring the completion with an idle timer which is reset on every keystroke. I'm reasonably confortable with this last technique and it is usually desirable regardless of other speed improvements, so I might have a look at that first. --=20 Jo=C3=A3o T=C3=A1vora