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#65250: 30.0.50; "C-h f" is much slower on the master branch Date: Mon, 14 Aug 2023 17:40:13 +0300 Message-ID: <835y5hbsc2.fsf@gnu.org> References: <838ragdzw5.fsf@gnu.org> <83cyzpbyuz.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19067"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65250@debbugs.gnu.org To: acorallo@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 14 16:41:24 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 1qVYl2-0004lr-6b for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Aug 2023 16:41:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVYki-0002Vg-BQ; Mon, 14 Aug 2023 10:41:04 -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 1qVYkg-0002Ty-Ed for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:41: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 1qVYkg-0001Lb-6k for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVYkf-0007Fq-N8 for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2023 10:41: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: Mon, 14 Aug 2023 14:41: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.169202404427855 (code B ref 65250); Mon, 14 Aug 2023 14:41:01 +0000 Original-Received: (at 65250) by debbugs.gnu.org; 14 Aug 2023 14:40:44 +0000 Original-Received: from localhost ([127.0.0.1]:34111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYkN-0007FC-HO for submit@debbugs.gnu.org; Mon, 14 Aug 2023 10:40:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYkM-0007F0-Cr for 65250@debbugs.gnu.org; Mon, 14 Aug 2023 10:40:43 -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 1qVYkH-00016x-6x for 65250@debbugs.gnu.org; Mon, 14 Aug 2023 10:40:37 -0400 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=Eskv0Jfq4GGj+XFk6KmAqJiZINUGN4hlbB0/xbbk6Lg=; b=WSzTQ1i996Yh jzfcV8TmykbYRTVlFJu7YoyqWe7/kQXDACO4iQUb9ayzBIlotjlGSeVIfQEXq1mbS8NcqkNvtrac5 WVOBRcYiJPEE1pFVUcdxe3Q+LlSI51IOAEpKrCuWhWgTp5r5UVmVxXdyZIQ6HkrTlFbGuO47h/xwv YDbgn9uPmbBE3h1+PZELvBwjMLhwQZsfNrZOJ0iinlfQfXc5uoFYqx/0rskc7HfAb+dohYPj2CwoX mdR2IWpmbMCusqF4kBj/QmirMWXWBLY6SjD/qH3lOveA83SU5NgWjUDcX4op30XI0SXnYx3Plqn10 Ezu5VyiN5euHIS0gV8KLIg==; In-Reply-To: <83cyzpbyuz.fsf@gnu.org> (message from Eli Zaretskii on Mon, 14 Aug 2023 15:19:16 +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:267422 Archived-At: > 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. I'm guessing your build was with native compilation? 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). 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?