From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#48841: fido-mode is slower than ido-mode with similar settings Date: Sat, 12 Jun 2021 00:24:52 +0100 Message-ID: <878s3gugqj.fsf@gmail.com> References: <87eedgy7pt.fsf@gmail.com> <1f659c88-4d9d-8fc9-733a-5e6068f9ed4a@yandex.ru> <87a6o3x5j7.fsf@gmail.com> <87y2bnv5xc.fsf@gmail.com> <35be6652-9c8d-ee21-e9eb-9598ad6777eb@yandex.ru> <858682b2-b8fd-898b-bef3-97dbe5e4debc@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12822"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , 48841@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 12 01:26:13 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 1lrqXU-00037z-TB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Jun 2021 01:26:13 +0200 Original-Received: from localhost ([::1]:52628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrqXT-0002Nb-O9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Jun 2021 19:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrqXK-0002L3-Jp for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 19:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrqXK-0001MD-Ak for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 19:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lrqXK-0004cr-0K for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 19:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Jun 2021 23:26:01 +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.162345390517711 (code B ref 48841); Fri, 11 Jun 2021 23:26:01 +0000 Original-Received: (at 48841) by debbugs.gnu.org; 11 Jun 2021 23:25:05 +0000 Original-Received: from localhost ([127.0.0.1]:40093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrqWP-0004bb-Et for submit@debbugs.gnu.org; Fri, 11 Jun 2021 19:25:05 -0400 Original-Received: from mail-wr1-f46.google.com ([209.85.221.46]:45643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrqWL-0004b3-9r for 48841@debbugs.gnu.org; Fri, 11 Jun 2021 19:25:04 -0400 Original-Received: by mail-wr1-f46.google.com with SMTP id z8so7608090wrp.12 for <48841@debbugs.gnu.org>; Fri, 11 Jun 2021 16:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=5N8MJefkkErbcKL3yt1Q9vafvlkOrDRcc5cHNlYH3oY=; b=jeyOO9w1HnpyeEhKZyftSZine1TmaS4L9p66qbGLXRFkLcwQwSAgAbGJGkzh1flYXQ MLDOV4H4p5CdyardbSHAzFJJHNRZ8N7EdBykA5urMsG+1xQzqEVpaIVvPfRZII1YljdT WMxcjz4r3QlehQQFNUo2ydulnWjjnu/M92lN6FJWz4Qc4wm1Mbuk1oGDZUi1HBbrR6fq j716JyUB9tT/pUBqEc3d79cZG0OTUV13VXcQbxRPNJui+rlDXxDAUOIjiCM3UcKKbTxi sIxXy3ZRkaG9FvFvOLtMwNw/08j3WVSM2HlVgYRxtJAoezbML984HSHIQkdYSey/35Pp lUgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=5N8MJefkkErbcKL3yt1Q9vafvlkOrDRcc5cHNlYH3oY=; b=JD32P5REqmK63ApRmFwl9rIq0NWGMm/S29P+VQ9+eCds9nRHdt6j30eSns6V4ti+Tg jCky4PmyJAN7F9zxvCZo+vI92buQwOppRkg6iFo6YsfIdWP+XZSNRNHGawb2EUfWQSO3 mK2S7jLvH5xYdNkkKO6MnQBgrlr2Cy3g4Uww+O49psJMTbiNHTT0DasOJ0bxLZ+qXyOa CahAfpwhaJfY4fR4Jt6LjWvk+gmX1LJs/7Di0YVS+03BmcpE3c2OeyMeZpkBYbjHJfE1 VD2SEn49wDPfXqlXt4lANgA9gowmz9JlxS46D6qK9p3YPYPG2oak7GzfH+JmtffbpKvZ 9lQw== X-Gm-Message-State: AOAM5312Mn/jJjaw+uN4zlMQyK/kNFQjiotvYGrV7Yn47nEQ1wcrv3EB E68j80oPBflCVFoO7YM9FKpxUW4byao= X-Google-Smtp-Source: ABdhPJxcLF9/4xNfprXm4s7vfV6ECLMSUL/8ckGimzRmb0spQkzfecuh7yWXfVptjshBsnMuxm/05g== X-Received: by 2002:a5d:4d4d:: with SMTP id a13mr6516012wru.33.1623453895006; Fri, 11 Jun 2021 16:24:55 -0700 (PDT) Original-Received: from krug (a94-133-55-152.cpe.netcabo.pt. [94.133.55.152]) by smtp.gmail.com with ESMTPSA id p15sm2767773wmq.43.2021.06.11.16.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 16:24:54 -0700 (PDT) In-Reply-To: <858682b2-b8fd-898b-bef3-97dbe5e4debc@yandex.ru> (Dmitry Gutov's message of "Fri, 11 Jun 2021 05:19:03 +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:208361 Archived-At: Dmitry Gutov writes: > Looking forward for your analysis of fido-vertical-mode's performance > improvement over the "normal" one. So, I benchmarked before and after this patch to icomplete.el: diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 08b4ef2030..3561ebfa04 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -858,16 +858,8 @@ icomplete-completions ;; removing making `comps' a proper list. (base-size (prog1 (cdr last) (if last (setcdr last nil)))) - (most-try - (if (and base-size (> base-size 0)) - (completion-try-completion - name candidates predicate (length name) md) - ;; If the `comps' are 0-based, the result should be - ;; the same with `comps'. - (completion-try-completion - name comps nil (length name) md))) - (most (if (consp most-try) (car most-try) - (if most-try (car comps) ""))) + (most-try nil) + (most "") ;; Compare name and most, so we can determine if name is ;; a prefix of most, or something else. (compare (compare-strings name nil nil The patch itself nullifies the calculation of the 'determ' thing that I and presumably some other users don't value that much. It doesn't affect fido-mode's basic funcionality. How did I benchmark? Well, to measure the delay the user experiences until all completions are presented I had to take out the `while-no-input` in icomplete-exhibit so that this test would work: ;; After the form, type C-u C-x C-e C-m in quick succession (benchmark-run (completing-read "bla" obarray)) If I don't remove this `while-no-input`, icomplete will not lose time showing all the completions and will instead select just the first one. That's a very nice feature for actual use, but for this benchmark that is not what I want: I want to measure the time to show all the completions. Then, the times presented by benchmark-run are the same that the user sees if he waits to see the completions. Now the values: Before my patch: (1.802209488 5 1.3678843490000077) (1.609066281 4 1.1170432569999775) (1.878972079 5 1.3725165670000479) (1.901952581 5 1.3979494059999524) (1.820800064 5 1.3283940110000003) After the patch: (0.552051921 1 0.3079724459999511) (0.58396499 1 0.3038616050000087) (0.861106587 2 0.6046198220000178) (0.611551175 1 0.30275532399997473) (0.62500199 1 0.3160454470000218) Without the patch but with icomplete-vertical-mode: (0.645366711 1 0.3412892389999911) (0.6256968110000001 1 0.3234302760000105) (0.9716317630000001 2 0.6676939319999633) (0.6414442749999999 1 0.3325084230000357) (0.627684562 1 0.32241421699995954) Jo=C3=A3o