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#50599: [PATCH] Don't recommend against "\[...]" substitutions for performance Date: Wed, 15 Sep 2021 09:38:53 +0300 Message-ID: <83v932bawy.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23456"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50599@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 15 08:40:22 2021 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 1mQOak-0005ty-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 08:40:22 +0200 Original-Received: from localhost ([::1]:33856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQOaj-0006lV-69 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 02:40:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQOaQ-0006lN-Eo for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 02:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQOaQ-0008Su-1D for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 02:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQOaP-0001wO-V6 for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 02:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Sep 2021 06:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50599 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50599-submit@debbugs.gnu.org id=B50599.16316879447391 (code B ref 50599); Wed, 15 Sep 2021 06:40:01 +0000 Original-Received: (at 50599) by debbugs.gnu.org; 15 Sep 2021 06:39:04 +0000 Original-Received: from localhost ([127.0.0.1]:50621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQOZT-0001v9-SX for submit@debbugs.gnu.org; Wed, 15 Sep 2021 02:39:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQOZS-0001uf-B6 for 50599@debbugs.gnu.org; Wed, 15 Sep 2021 02:39:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54470) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQOZN-0007b6-03; Wed, 15 Sep 2021 02:38:57 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3429 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 1mQOZL-0002VJ-5I; Wed, 15 Sep 2021 02:38:56 -0400 In-Reply-To: (message from Stefan Kangas on Wed, 15 Sep 2021 08:27:55 +0200) 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" Xref: news.gmane.io gmane.emacs.bugs:214358 Archived-At: > From: Stefan Kangas > Date: Wed, 15 Sep 2021 08:27:55 +0200 > > (progn (require 'ibuffer) > (let ((times 100)) > (/ (car (benchmark-run > times (documentation 'ibuffer-mode))) > times))) > > => 0.00499586008 > > When I increase the number of substitutions in that docstring to around 1000 (by > duplicating the docstring 10 times), I get: > > => 0.05029239337 > > This is 10 times slower, but still fast enough that it does not matter much. > It also suggests that this is O(N) in time. > > My conclusion is that the above recommendation in `(elisp) Documentation Tips' > is irrelevant these days, and I suggest to remove it. > > Please see the attached patch. Thanks for the research, but the removal you propose is too radical. The text already says "very many times". You are saying that on your system (which has what CPU, btw?) "very many" is a very large number, but even for you 1000 references takes 50 msec, which begins to be significant. So I'm okay with somehow modifying the text to provide a better idea of what "very many" means nowadays, but I think the advice is still valid and shouldn't be removed. We cannot guarantee that arbitrarily large number of such references will not slow down help display.