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:29:29 +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="13986"; 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:31:36 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 1md4CO-0003U9-4k for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 07:31:36 +0200 Original-Received: from localhost ([::1]:41786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1md4CM-0005am-0C for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 01:31:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1md4Aa-0005ZP-1I for help-gnu-emacs@gnu.org; Wed, 20 Oct 2021 01:29:44 -0400 Original-Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]:35362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1md4AY-00016d-FR; Wed, 20 Oct 2021 01:29:43 -0400 Original-Received: by mail-ua1-x92b.google.com with SMTP id q13so4463584uaq.2; Tue, 19 Oct 2021 22:29:41 -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=qZS8zaZ3qbC05XC8yskfh+MGRBDp9hGx30wOWM5OK4g=; b=QVP6FT3h5TL8rhW6qejDcXmDJo4t8Jr7LNv2FZJ15RRWNDNqD5SOmov955IQbKd6Bj BrfkdTHLbv/H4qq+A6gqcKDJuVTPdzaiIyCkOhvWCIoSAqq755gEk/lD7i6KZniLITZ2 dd3GkLKv4up07NeTCjN9eQG4ISlKEna1aB/AeGxwDEqw8LxArBjBgNSd4S0zfNtRFuU1 g7ahk+E/mMl7V7CipiOxyP8jo1VaytNH7N2Nx8ttBjX9lGKtG68sFN52jrnK8cUVjtue c8qdDfTYWa0y2JHeAsFEAZ4IG1rNbg4us7+9J4nHtc7YhbrnqIPCkO1UnanR2hpiK7UM 0iVg== 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=qZS8zaZ3qbC05XC8yskfh+MGRBDp9hGx30wOWM5OK4g=; b=ID7jSSuxB8/f3d6SP4xzoFyCS57IxtMKuIkw8Fx9s6pIAtZTZG+BvjbSQ8Dk7fAwc2 LYJYSj10fiCGUiN5/glhQ9P1T03m8e+tO/LvBgmHVeJ5Gk+CkDVAaZw+gXF0jBhC5nVY muDSZXplzpkG/jTah1LTLTih06YiC9jSAEoIscVL14oQaR5j/tSbyH4/abF+WCk6ElKY mpaNQOgnnnPFKBvgBH+SQKbLZSFsFEdu3tyr2EDwA1Rv980AuUx9pNsFcZKFV8h5VMON xKAeI+1sxWRiQTGnTY9NET0KSSC6BmcB9TOOZWKnf2e0uDNJvvI9AFY1j+K1OkAthsAX 5i9Q== X-Gm-Message-State: AOAM531J7gBD/t1ufqS8OsMfvVo3ZehkB5jdplS1ZB8App0fDH9OMF4Y hkcucPuFzGlpu0l/pjC7za+/bSaTetCF19ZsFtDvQXDf9z46xQrn X-Google-Smtp-Source: ABdhPJydHZr/jU1nSiVEQ9+0j3C7xf4zNP7IiKxNHvDIKPCNtSrp3Mju8ll99Tm8qyO5enUD/OpHTwGUr8o6l0x6hJc= X-Received: by 2002:ab0:3cac:: with SMTP id a44mr5156865uax.129.1634707780577; Tue, 19 Oct 2021 22:29:40 -0700 (PDT) In-Reply-To: <87tuhcs2ov.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::92b; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x92b.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:133901 Archived-At: 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 the > > 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) > `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=98minibuffer.= el=E2=80=99. Its value is nil > Then again with `company-mode' but first without the numbering hack, and > 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