From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yikai Zhao Newsgroups: gmane.emacs.bugs Subject: bug#59678: [PATCH] sh-script: use completion-table-with-cache to improve performance Date: Sat, 3 Dec 2022 01:00:00 +0800 Message-ID: References: <20221129143013.191469-1-yikai@z1k.dev> <83k039gbtg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6797"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 59678-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 02 18:03:06 2022 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 1p19RJ-0001ZW-RD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Dec 2022 18:03:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p19PU-0000Yn-1f; Fri, 02 Dec 2022 12:01:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p19PK-0000WT-N8 for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 12:01:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p19PK-0006CH-8y for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 12:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p19PK-0007U7-3t for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 12:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yikai Zhao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2022 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59678 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59678-done@debbugs.gnu.org id=D59678.167000042628754 (code D ref 59678); Fri, 02 Dec 2022 17:01:02 +0000 Original-Received: (at 59678-done) by debbugs.gnu.org; 2 Dec 2022 17:00:26 +0000 Original-Received: from localhost ([127.0.0.1]:47727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p19Og-0007Ti-HE for submit@debbugs.gnu.org; Fri, 02 Dec 2022 12:00:25 -0500 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:39579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p19Ob-0007TY-Cn for 59678-done@debbugs.gnu.org; Fri, 02 Dec 2022 12:00:21 -0500 Original-Received: by mail-pf1-f181.google.com with SMTP id 140so5439463pfz.6 for <59678-done@debbugs.gnu.org>; Fri, 02 Dec 2022 09:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=z1k.dev; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=URQxuhT3PGvLFZTYUy/0lTi5xM2/g85uYJ5+esjlIzI=; b=LaXG7CABrZgD8KPv4BwAyzFLMCFjQh6m0txQUj/oyYW2QOii6XPDPEhSYcvEeytWU1 tX32izrm/HLjGSyabozd24wCsgENUo4eM5vX6BmDEDlz9ZhGrLxNXiQJWRS4W0cO5xDt f1z/4XvXMv4KbNPKyufDhZvHv2Pa90X0PlfTAmlxH97rI9FGMUpeFZ4wkePumqduOF/N 0CUk6pkW8pWOjqcka2K2oniVdceV/dnyzLOEnnLr7zDtZhvlF9AxiAW1K9it/ckGWp97 wwKrqeQ7XLnvzHSQVUFyuCTlZfwR3UIW3K3+G6zoktDUx5hxJLCgbgGEMburePSRZ6Bp Fdig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=URQxuhT3PGvLFZTYUy/0lTi5xM2/g85uYJ5+esjlIzI=; b=doEYEZwL8X3mg87DCSp8z9IaqQj5aQfbdLPRncS+4U5/zf4bHO87EH3LoBArhPc7N3 eNVqOYBhXaXtkXPuufGJXMtdb6bF2smHcUHakGS06ePoELeQ3RAtQCmU5h0AjJnVYALJ DBMSt1TIc/fLkX2w+mog99MyWR4+kCR6/L0mh3QR0cH8iOhT80lHWOLEyLgAf9osXvEd TIzqq9wDF9uuR+MLP0IxoRp5shdhzYn7KXFB+2HlRaQY56Gmf1XJMLTcIQhmZqPVqaoj Ybv9DViTMQi2PWFgCiK4UXD/2+IrKJuVMG6FDiP/zfn7RELyahQZTe5fC2At3nz/xNr1 vxyA== X-Gm-Message-State: ANoB5pn6KCAC+JdNvCZdYW3ga6D6k2vFuShVUj5OFzARqLu0AivYiIhb bdwy0F6Cu03iA6pQQR1H0zA5CYtB3NopY8fFuty0bA== X-Google-Smtp-Source: AA0mqf45+2OmOISfQBSAMaD6bB7vmpX9yADS6rrrHBhz0WKj3wG8Qqej4of0BUTqv0SBC3SgL1HGaak3o5rCDEtYnJA= X-Received: by 2002:a62:f20c:0:b0:576:d5c:fc1c with SMTP id m12-20020a62f20c000000b005760d5cfc1cmr10358688pfh.26.1670000411475; Fri, 02 Dec 2022 09:00:11 -0800 (PST) In-Reply-To: <83k039gbtg.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249768 Archived-At: On Fri, Dec 2, 2022 at 9:44 PM Eli Zaretskii wrote: > > > Cc: Yikai Zhao > > From: yikai@z1k.dev > > Date: Tue, 29 Nov 2022 22:30:14 +0800 > > > > Hi, > > > > I found that the auto-completion on .sh files (with company-mode) was pretty slow (takes several seconds). > > It turns out that company-mode would call the capf function with 'metadata action for each candidate, > > where each function call would need to list all the cmds. In this patch, I modified the code to use > > completion-table-with-cache which fixes the problem for me. > > Thanks, installed on the emacs-29 branch. > > In the future, please accompany your changes with ChangeLog-style commit of > messages (see CONTRIBUTE for the details). Thanks. I will do that next time.