From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Too long completion delay time in LISP interaction mode. Date: Wed, 20 Oct 2021 13:58:56 +0800 Message-ID: References: <87tuhcs2ov.fsf@gnu.org> 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="21330"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 20 07:59:35 2021 Return-path: Envelope-to: geh-help-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 1md4dS-0005Kl-Vr for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 07:59:34 +0200 Original-Received: from localhost ([::1]:53166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1md4dQ-00068c-Ui for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 01:59:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1md4d5-00068N-I3 for help-gnu-emacs@gnu.org; Wed, 20 Oct 2021 01:59:11 -0400 Original-Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]:36602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1md4d3-0008Qs-OT; Wed, 20 Oct 2021 01:59:11 -0400 Original-Received: by mail-ua1-x929.google.com with SMTP id e10so4540369uab.3; Tue, 19 Oct 2021 22:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=C369wk3hu6yH0R+eP/d6FWXYGjxlUKps9T+uIO/Bzx8=; b=H2b4XMV3GZHQgR/r9zZphwxMDs+ueabkwwGKAyVwsAcKov3JcT75g8Oe+CZMTEN9vi g9dZzzHksdpMdUpl85YWc54Zr3NM0JGRAO0r8JAGyh/h/re7gd1GHeF9EOs8FKPhg65K hX/zzoVOomNX/h0aL3dh1MNscKxEoyeoJNjifq+50xfVfSPoLpjUE+G61DGhcx0H4SPR 78eZxoM0dzv949KiQSt2fvTqKaweq3IU1A9VdtQtIr2vRj6hPOf7WKk2pJtLnCcx8xEu Vh/llgpyljW5yxM3WfwuJcnh+chz67UgshleDDykUWOjFm9egQZ4eWgl5zHeMKGXAs0N WBbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=C369wk3hu6yH0R+eP/d6FWXYGjxlUKps9T+uIO/Bzx8=; b=z/H76GcK9rVJvnkrk+a/TzRr5azWDHvxr27z8cY6XUntSVtNcpBkO5Z/F4rr5DDG39 Hh7xsr1jbQ7qZ6c7JBxpEzyoMPnL4F6geAKN8nFisBmDioXAKH2xqnd5Ao04kaxARCEB GFuc99XRbE0XO9m8RLT+7D27xotQtkIvveLo8XVcWSKRyH63cbxC7bBt3S0LHLX6UVUI Sa4May/O1BKxepAzWoZ9ddPQcxWQlGjBIz5fL9uBBZrb+xscwoDyo51Q9KQleSLBA2vZ 6zrQthtOf5NtGkcPSbtZweQwPpKWYvN6DSxnl7K+X/I60KBMqAZth5/t+sMNDAkoUO/E XeQQ== X-Gm-Message-State: AOAM531DbfaYp0bPj5N0nPH6wWGH2pcXLm9xYfMLvpWzvouCxf5jwoqe O5pjrOCCJ5jy5ExYfYjNjIB6PKWW2NyI78dencdgO+cMw0lb7moD X-Google-Smtp-Source: ABdhPJwunYSGC2eVQvhxixj88e5h3zuVmYPAbOlUtLaMjZ5zIq9rTok769qR0wRuwRlXNQ7oaT8X//7vB9TBtOf/Pxw= X-Received: by 2002:a05:6130:328:: with SMTP id ay40mr5318067uab.60.1634709548049; Tue, 19 Oct 2021 22:59:08 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::929; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x929.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133905 Archived-At: On Wed, Oct 20, 2021 at 1:29 PM Hongyi Zhao wrote: > > On Wed, Oct 20, 2021 at 1:08 PM Tassilo Horn wrote: > > > > Hongyi Zhao writes: > > > > > On Ubuntu 20.04.3 LTS, I'm using the self compiled Emacs git master > > > version. I find there is a very long completion delay time in LISP > > > interaction mode. For example, when I type `(map)' in scratch buffer, > > > there will have 5070 candidates as shown in the attached file, and th= e > > > completion delay is about 2-5 seconds. > > > > > > Any hints to improve this phenomenon? > > > > First, I'd try to isolate where the slowdown happens. The screenshots > > suggests you are using company-mode with custom hacks to get the > > numbering of candidates and you are using some fuzzy completion-style. > > > > So I'd start with emacs -Q and typing (map in *scratch* to get the > > *Completions* buffer. That will probably be fast but deliver less > > results because of the default value of `completion-styles'. Then I'd > > try out your settings of `completion-styles' (and > > `C-h o completion-styles RET' > > completion-styles is a variable defined in =E2=80=98minibuffer.el=E2=80= =99. > > Its value is (hotfuzz) > Original value was > (basic partial-completion emacs22) I've the following configuration in my `~/.emacs.d/init.el': (use-package hotfuzz :init (setq completion-styles '(hotfuzz))) And it seems that commented out the above code snippet fixed the problem discussed here. HZ > > > `completion-category-overrides' if you have customized that). > > `C-h o completion-category-overrides RET' > > completion-category-overrides is a variable defined in =E2=80=98minibuffe= r.el=E2=80=99. > > Its value is nil > > > > Then again with `company-mode' but first without the numbering hack, a= nd > > eventually with it. At which step does it become slow? > > > > Also, using the profiler might shed some light on where the time is > > spent, see (info "(elisp) Profiling"). > > `M-x profiler-start RET cpu and mem RET' > > Typeset (map) in scratch buffer, and then > > `M-x profiler-report RET', gives the following results: > > > 262,542,852 87% - command-execute > 262,542,852 87% - funcall-interactively > 262,538,196 87% - counsel-M-x > 262,538,196 87% - let > 262,355,940 87% - ivy-read > 262,355,940 87% - apply > 262,354,884 87% + # > 182,256 0% + counsel--M-x-externs > 4,656 0% + self-insert-command > 36,160,744 12% + company-post-command > 368,131 0% + redisplay_internal (C function) > 135,480 0% + timer-event-handler > 7,442 0% + eldoc-pre-command-refresh-echo-area > 2,640 0% + highlight-parentheses--initiate-highlight > 2,112 0% + jit-lock--antiblink-post-command > 1,056 0% + company-pre-command > 0 0% ... > > HZ --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province