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: Sun, 17 Mar 2019 21:46:00 +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> 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="193357"; 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 Sun Mar 17 22:47:37 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 1h5dcz-000oA8-Rs for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 22:47:34 +0100 Original-Received: from localhost ([127.0.0.1]:60575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5dcy-0000Kn-O5 for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 17:47:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5dbj-00007o-I9 for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:46:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5dbi-0000Cw-Ow for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:46:15 -0400 Original-Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:35137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5dbi-0000CO-DC for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:46:14 -0400 Original-Received: by mail-qt1-x832.google.com with SMTP id h39so15874572qte.2 for ; Sun, 17 Mar 2019 14:46:14 -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=xMDMMONVdA+r1CCxL0Cl04mDnJmuHU2ziO74V6B5AvA=; b=GgYTRq4UxN2k/ENfaHwzWhw+oqC35N2SZsBhFXoFq8P92cw3zJX3A/GTXSleSfElPE ikqKMOLCJkF4VaaZDMGo138Yyl/FnKdFaQFmR+2Xelgp1gfrvAYeppfnk+jWihYHCwDi Oi7hQIaJSUSAdM6OehtpDENVcEMwYZ09j+uwoVMhtivu44biHQo6OJcnVuVdhu8yup0+ j0Z8ZHR4RltS3s0jhYW1HXJSRXqQ3RAYGPpVz6ymwc9VNZZhavCx4ChUpbJTwV9j6Vd9 RSLE+1DtPtULRwN4elfPiTMi+GuScXwTX4QKUvJTI76GcG/FO2Jt7OIBK/O1gsO7oC0+ 5UOg== 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=xMDMMONVdA+r1CCxL0Cl04mDnJmuHU2ziO74V6B5AvA=; b=Az9TiJLjvYlI82EwuBRU/KFmxGlAw/wsonI1b8P3L3Q94tOipz9dsCcY32CZ07waa1 gxNTglW98aMZTkv8NLLhbe9PSCBBjrWvGfbfergdVlPfKfPY9T5rYCEniCNURl99y49o iF5HmKvOX9PuvXBo+qKOuNBtIjow210PCTPe6ThhTIOKaCJf6t81XxDjeV6AsPwGZalj +dfC35CUU2AYvcrBJCHV7aWPJa8AzJCDJho7d/afyVxRPGpAgesKPKWX9EAc+3hvYnOy g8+dWoDB7cKNBAs2MptW9t1s1VfJpWC1yvKIeMQ8AWd37Dmd7zflvozuLqhhTWdfBdzT AMlw== X-Gm-Message-State: APjAAAW3U3zUe+q/+rPiZGfncyDrjAXDvA9CKJj1GYO/ukmyzdFmRgpi BF77dkoufQcK3SQo33ERshW4TM+TjXIM0VRRfdk= X-Google-Smtp-Source: APXvYqzJlxmyWSYh4W0a46CqGxtf2zL9DP2Zcq0Dl3HTBPqe+Zfj+sAGAfHAuMW30YrR0o+zzfmQ43Z1ZlQL+SgWTig= X-Received: by 2002:ac8:1a55:: with SMTP id q21mr11307378qtk.20.1552859173598; Sun, 17 Mar 2019 14:46:13 -0700 (PDT) In-Reply-To: <4f4e9ccd-b152-2b37-cad2-6c96b0a64d84@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::832 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:234307 Archived-At: On Sun, Mar 17, 2019 at 8:32 PM Dmitry Gutov wrote: > I like for it to be clear what is affected by a variable, and what does > not. Both from its name and its docstring. Well, for now _nothing_ is affected by that variable. Let's change the name when that changes. > "Slow" had been my impression with flx (the third-party package), but > didn't it come from scoring rather than matching? No idea. The slow in flex almost surely _doesn't_ come from the scoring. > As long as we're using the same approach for constructing the matching > regexp as ido-flex does, speed should be okay for most uses. I haven't checked. But I remember either you or Stefan saying that it uses a regexp similar to pcm's. > Another thing I'd like to note: with flex completion, RET doesn't select > 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)) + wh= at? > > I wonder > > if ditching pcm's regexp based approach and coding something by > > hand (perhaps in C) would be faster. I haven't done any > > measurements but the thing feels slow to me: so I wish more > > people could experiment with it (and with company, too) > > ...although it does feel a bit slower than the prefix matching. Maybe > that's just to be expected. You're right, more or less, at least judging from some benchmarks: (benchmark-run-compiled 100 (let ((completion-styles '(flex))) (completion-all-completions "kill" obarray nil 0))) ; =3D> 4.76s (benchmark-run-compiled 100 (let ((completion-styles '(basic))) (completion-all-completions "kill" obarray nil 0))) ; =3D> 3.7s ... and the first returns a much larger list. I was expecting to see much larger differences, though, since my icomplete and company-based experience is really sluggish. But I wasn't using these much for the default completion style anyway. Or maybe the sluggishness is coming from somewhere else. Anyway, as I predicted, most of the work is the matching in completion-pcm--all-completions. I'll try to hack something there when the pattern has some simple flex-like form. Jo=C3=A3o