From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63132: Bug on Darwin MacOS with 'M-x man RET commandname[ ]' Date: Wed, 03 May 2023 15:09:09 +0300 Message-ID: References: <80D2DED5-3B41-4F1A-8B7E-9F0C44067461@gmail.com> <837ctwsfst.fsf@gnu.org> <831qk4sayd.fsf@gnu.org> <83wn1wqobx.fsf@gnu.org> <83jzxsng5l.fsf@gnu.org> <83h6svor2g.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13117"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eliz@gnu.org, monnier@iro.umontreal.ca, asocial-hired.0l@icloud.com To: 63132@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 03 14:10:20 2023 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 1puBJM-0003DZ-AK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 May 2023 14:10:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puBJC-0001Bx-EY; Wed, 03 May 2023 08:10:10 -0400 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 1puBJ4-0001Ai-Gj for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 08:10:03 -0400 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 1puBJ4-0002iS-6z for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 08:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puBJ4-0001S3-2E for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2023 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63132 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Eli Zaretskii , 63132@debbugs.gnu.org, Stefan Monnier , asocial-hired.0l@icloud.com Original-Received: via spool by 63132-submit@debbugs.gnu.org id=B63132.16831157585496 (code B ref 63132); Wed, 03 May 2023 12:10:02 +0000 Original-Received: (at 63132) by debbugs.gnu.org; 3 May 2023 12:09:18 +0000 Original-Received: from localhost ([127.0.0.1]:45807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puBIM-0001QZ-B4 for submit@debbugs.gnu.org; Wed, 03 May 2023 08:09:18 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:56678 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puBIH-0001QN-HU for 63132@debbugs.gnu.org; Wed, 03 May 2023 08:09:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1683115753; bh=R9mGxVkCH/RJo6V8Zv9u2y7Z9nyeWkUslnLjpjIv+XI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GVI3bH9Pp8qrOLut4MiU4nooYoOzb+CcRMWbrCk0gS5x+vKnpjrJpHrlvgQ1B/Ste BnzvMFZEtGnjlnfWwt3pgorgOgkZJWzKlPY8nHDURG+FTd46YvibWkzenzcHiO2UKg K/LnzB3YyIM0DOp+CL/n+hE2/p315Y6WRYKVhHgFcD0iiy4U4ijiD6iLsrTCynSe+o 6B2qeh04B2k0lg146bKQfr7SZUkntPZb/9V2CB7AnyKWS9C4gQheW7wBIwEn2EmkD+ Cugoy8uAVEEik65NJ0qpHmB1vyxEeLUeFdgzjDEIQ/XfJJiJpByUEE5lOIfRXt41kT VIdFZNBF1W35w== In-Reply-To: (Stefan Monnier via's message of "Tue, 02 May 2023 09:17:53 -0400") 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:260975 Archived-At: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: >> On my i9 Ventura MacBook Pro, just running `man -k read > /dev/null` >> takes almost 2.5 seconds, it'd seem that's indeed the main cause of this >> lag in `M-x man` completion. > > Hmm... here on my 10 years old desktop running Debian stable it's more > like 0.03s. If it's so slow even for situations where the users have > already typed `read`, ... hmm ... maybe we should try and make the > completion asynchronous or at least abort the `man -k` as soon as the > user types something, or add some level of caching...? > Note that there is already some caching in place, but it gets reset between invocations of `M-x man` and it only hits if the previous input for completion is a prefix of the next one. AFAICT Stefan added this caching back in 2009 along with a comment that seems to be relevant still: --8<---------------cut here---------------start------------->8--- On my machine, "man -k" is so fast that a cache makes no sense, but apparently that's not the case in all cases, so let's add a cache. --8<---------------cut here---------------end--------------->8--- Perhaps we could do some more aggressive caching under the condition that "man -k" is really slow (as determined by e.g. some `Man-man-k-slow-p` variable that'd be non-nil by default on macOS)? -- Eshel