From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#65250: 30.0.50; "C-h f" is much slower on the master branch Date: Mon, 14 Aug 2023 10:51:46 -0400 Message-ID: References: <838ragdzw5.fsf@gnu.org> <83cyzpbyuz.fsf@gnu.org> <835y5hbsc2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37319"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65250@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 14 16:52:25 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 1qVYvg-0009Xn-F9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Aug 2023 16:52:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVYvL-0005Bm-Kt; Mon, 14 Aug 2023 10:52:03 -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 1qVYvK-0005BM-M8 for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:52:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVYvK-0003bc-Dr for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVYvJ-0007bE-Vd for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Aug 2023 14:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65250 X-GNU-PR-Package: emacs Original-Received: via spool by 65250-submit@debbugs.gnu.org id=B65250.169202471529200 (code B ref 65250); Mon, 14 Aug 2023 14:52:01 +0000 Original-Received: (at 65250) by debbugs.gnu.org; 14 Aug 2023 14:51:55 +0000 Original-Received: from localhost ([127.0.0.1]:34127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYvC-0007au-KD for submit@debbugs.gnu.org; Mon, 14 Aug 2023 10:51:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYvA-0007ag-AP for 65250@debbugs.gnu.org; Mon, 14 Aug 2023 10:51:53 -0400 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 1qVYv5-0003Zq-2n for 65250@debbugs.gnu.org; Mon, 14 Aug 2023 10:51:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WHlP5ZEsEczZ3MT5mcPMPcUfIJDxT8TKffSkCQIiQPA=; b=nwoKBZHLOPa5psF7xkWk IIv+SLTshf7g1OlHBPqL5CFQbZFJZzvzV0znZmusaYcC4pVp112eBZOneTg7AoDhdQ9rDGCYu7jqv 9j9Pa0hD8vfyxkp98NMxpfNy/CT8LPBmvqwfgu9H1xf+MiW9BJ6JmE3r+w5Cq8cRYHH5NVaJYT2vK tpghO888K/EW2dQ03zClc/tJkF/jD1/BPnjMoDoDPFTWytDUyV06cHdRp0gxu06Ru57CjrOiZkyeV PEZ0ki1TTNLvVmv6dr9I5zkMFIsJw4PFMy5AKf7aRET8X3WAVKbRzXRcn7E7/2bO2xBdH9WJPKO/Y vU9gKEddQLh2vw==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qVYv4-0006xn-Ri; Mon, 14 Aug 2023 10:51:46 -0400 In-Reply-To: <835y5hbsc2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Aug 2023 17:40:13 +0300") 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:267425 Archived-At: Eli Zaretskii writes: >> Cc: 65250@debbugs.gnu.org >> Date: Mon, 14 Aug 2023 15:19:16 +0300 >> From: Eli Zaretskii >> >> 'configure -C --prefix=/d/usr --with-wide-int >> --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' >> >> Perhaps --enable-checking makes the difference? >> >> If even that doesn't show the problem, just time the above and compare >> with Emacs 29: it's possible that the command is much faster on your >> system, but the question is it significantly slower than Emacs 29? > > It sounds like the problem is the packages that Emacs needs to load > when comp-function-type-spec is called. If I set force-load-messages > to t before invoking "C-h f", I see this in the *Messages* buffer: > > Loading help-fns... > Loading cl-lib... > Loading cl-loaddefs...done > Loading cl-lib...done > Loading help-mode...done > Loading radix-tree...done > Loading help-fns...done > Loading thingatpt...done > Loading dictionary... > Loading dictionary-connection...done > Loading external-completion...done > Loading dictionary...done > Loading lisp/emacs-lisp/comp.el (source)... > Loading bytecomp...done > Loading cl-extra...done > Loading cl-macs... > Loading gv...done > Loading cl-macs...done > Loading cl-seq...done > Loading rx...done > Loading subr-x...done > Loading warnings... > Loading icons...done > Loading warnings...done > Loading lisp/emacs-lisp/comp-cstr.el (source)... > Loading pcase...done > Loading lisp/emacs-lisp/comp-cstr.el (source)...done > Loading derived...done > Loading lisp/emacs-lisp/comp.el (source)...done > Loading shortdoc... > Loading text-property-search...done > Loading shortdoc...done > > Note the loading of comp.el and comp-cstr.el -- we load their source > files, not the *.elc files. That's because in a build without native > compilation these two files are not byte-compiled. I think loading of > these files, especially of comp.el, in source form is what slows down > the command. Maybe, comp-cstr.el might have even a bigger part. > I'm guessing your build was with native compilation? Yes, I was experimenting just now (and failing to reproduce) with CFLAGS='-O0 -gdwarf-4 -g3' ./configure --without-x --with-native-compilation=yes --prefix='/home/andcor03' --enable-checking=yes,glyphs --with-wide-int > Because in such > a build the "C-h f" command is indeed fast, especially after the > requisite *.el files are all native-compiled (i.e. starting from the > second Emacs invocation after the build). Ah right! now it's all clear! > So I think the patch I presented in my original report is exactly what > is needed here: the problem only happens in builds without > native-compilation, and in that case there's no reason whatsoever to > call comp-function-type-spec. (And builds from a release tarball will > not see that problem, since the tarball comes with byte-compiled > comp.el and comp-cstr.el.) > > Do you agree? I certainly do. Thanks for the anylysis and the patch! Andrea