From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59678: [PATCH] sh-script: use completion-table-with-cache to improve performance Date: Fri, 02 Dec 2022 15:44:11 +0200 Message-ID: <83k039gbtg.fsf@gnu.org> References: <20221129143013.191469-1-yikai@z1k.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38302"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59678-done@debbugs.gnu.org To: yikai@z1k.dev, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 02 14:45:57 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 1p16MX-0009hm-JX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Dec 2022 14:45:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p16Lv-0003G4-NE; Fri, 02 Dec 2022 08:45:21 -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 1p16Le-00036T-EY for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 08:45:03 -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 1p16Ld-0008TM-US for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 08:45:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p16Ld-0005b9-Oj for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 08:45:01 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2022 13:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 59678 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 59678@debbugs.gnu.org, eliz@gnu.org, yikai@z1k.dev Original-Received: via spool by 59678-done@debbugs.gnu.org id=D59678.166998868821488 (code D ref 59678); Fri, 02 Dec 2022 13:45:01 +0000 Original-Received: (at 59678-done) by debbugs.gnu.org; 2 Dec 2022 13:44:48 +0000 Original-Received: from localhost ([127.0.0.1]:46813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p16LP-0005aW-Po for submit@debbugs.gnu.org; Fri, 02 Dec 2022 08:44:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p16LK-0005aO-Pf for 59678-done@debbugs.gnu.org; Fri, 02 Dec 2022 08:44:46 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p16LE-0008Pt-SG; Fri, 02 Dec 2022 08:44:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VK3Nvy+gwAXf53eUvjmbEvDBayJmOpx3SA1jZ8DV2W4=; b=pByIW/rcKTSu jiwlDLCvBa3DaftbaHJrLnVC+sQpdk+trNiJUe8Vs+QkFzGsyoitaA2i9nqZ/H0V8sPlQ6NG5ByhM oTckqR9BU5KcRi4XUNN9kcNZ3hsD/8dpEMirsDKmetcxUdfKrAvUIw2xu5xxpFZkugPodDIX4mRoz c7gXaFaGRdE5qtiC7vKkuxI2vLjR/ijW4q+7M5PlHcxLXED3phZ8ArOGvY54ZTfjHq7ONpYvMlWzq EbrN3kyKBTHoc/RQcFt0sTHBk4k0PdO3bDUKF4fdN9j6ysp0vw9RkNQjFNj5fmG+qzq+f3h6dtn1u EadA990X+67H/58fmDrlhA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p16LE-0006A2-8l; Fri, 02 Dec 2022 08:44:36 -0500 In-Reply-To: <20221129143013.191469-1-yikai@z1k.dev> 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:249742 Archived-At: > 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).