From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness Date: Wed, 20 Mar 2019 08:09:51 -0400 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 Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="14275"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel , Dmitry Gutov To: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 20 13:17:46 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 1h6aAE-0003eY-BK for ged-emacs-devel@m.gmane.org; Wed, 20 Mar 2019 13:17:46 +0100 Original-Received: from localhost ([127.0.0.1]:47239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6aAD-0005PF-2I for ged-emacs-devel@m.gmane.org; Wed, 20 Mar 2019 08:17:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6a9r-0005Jh-9M for emacs-devel@gnu.org; Wed, 20 Mar 2019 08:17:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6a2c-000761-TA for emacs-devel@gnu.org; Wed, 20 Mar 2019 08:09:55 -0400 Original-Received: from mail01.iro.umontreal.ca ([132.204.25.201]:37172) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6a2c-00074U-Gc for emacs-devel@gnu.org; Wed, 20 Mar 2019 08:09:54 -0400 Original-Received: from mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) by mail01.iro.umontreal.ca (Postfix) with ESMTP id 08BB980DBBF7 for ; Wed, 20 Mar 2019 08:09:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; h=content-type:content-type:mime-version:user-agent:in-reply-to :date:date:references:message-id:subject:subject:to:from:from; s=dkim; t=1553083792; x=1553947793; bh=DJuAgVKEyZi5GrtPdf3c6rtW 87FXE+VBV05wYhcVkDg=; b=AZomm44wVeq8qCKtHAmKu27DklXT+ApcKBycTpjB uKit2w5azA1L9DcpIss157r1XlLqWs5HfJJ6+E6yoO1q514ueR0jSpqOw5klSkVe sX5SR3/kRPqFlH8m22qD23jtBXuhIbucgodT/9wjmv1RvezIvMm1xV8+fZU3otzW WeHnb5lmWLE3oetlBAj2Yz1bke0NGXOUKMBA3k6A/DCOIB2xm8T9D4ECPU+tBLwx lw3YJy/nrgNEcnw7R/zMTwC1jExElpqUSLP9HuG8S0tzIhB6vCwUoY8Vhou8NDv7 gXIsCPGWd0HWYemgMwFFD/4eu6ZnpXqg51nM2LbpClM4iQ== X-Virus-Scanned: amavisd-new at iro.umontreal.ca Original-Received: from mail01.iro.umontreal.ca ([127.0.0.1]) by mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zwYEDsoBeZsX for ; Wed, 20 Mar 2019 08:09:52 -0400 (EDT) Original-Received: from pastel (75-119-242-252.dsl.teksavvy.com [75.119.242.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1689D80DBBDE; Wed, 20 Mar 2019 08:09:52 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Jo=E3o_T=E1vo?= =?windows-1252?Q?ra=22's?= message of "Wed, 20 Mar 2019 09:59:10 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.201 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:234401 Archived-At: >>> 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. >> I was actually comparing flex vs basic in this scenario, and the >> former was 2x slower. Which is, IDK, could be noticeable. > I understood that. I was just saying that in the "2x slower" case, well > more than half of the time is still spent in > completion-pcm--all-completions. FWIW, I think if basic is fast enough and flex is 2x slower, then flex is likely fast enough as well (or the contrapositive: if flex is too slow and basic is only 2x faster, then basic is also too slow). >> It's worth a try. But if filtering will happen right away after the >> user has stopped typing, that might mean higher CPU usage and lower >> battery life on a laptop. Just something to be on a lookout for. > You're absolutely right. And anyway I noticed icomplete _already_ has a > while-no-input there, so that technique has already been tried. Not really: the while-no-input was added long after the rest of the code was written and was mostly designed for the case where the completion data takes a *very* long time to get, the main purpose being to be able to enable icomplete for *all* completion tables rather than only for those we know to be fast enough. Stefan