From unknown Sat Sep 20 12:59:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73766 <73766@debbugs.gnu.org> To: bug#73766 <73766@debbugs.gnu.org> Subject: Status: 30.0.91; (documentation 'pcase) can take several seconds Reply-To: bug#73766 <73766@debbugs.gnu.org> Date: Sat, 20 Sep 2025 19:59:34 +0000 retitle 73766 30.0.91; (documentation 'pcase) can take several seconds reassign 73766 emacs submitter 73766 Yikai Zhao severity 73766 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 12 04:02:46 2024 Received: (at submit) by debbugs.gnu.org; 12 Oct 2024 08:02:46 +0000 Received: from localhost ([127.0.0.1]:36200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szX5J-0003t8-1m for submit@debbugs.gnu.org; Sat, 12 Oct 2024 04:02:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:36912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szX5E-0003sw-LC for submit@debbugs.gnu.org; Sat, 12 Oct 2024 04:02:43 -0400 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 1szX4y-0007PO-Ae for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 04:02:25 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1szX4t-0006Ln-OX for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 04:02:23 -0400 Received: by mail-wr1-x444.google.com with SMTP id ffacd0b85a97d-37d4fd00574so1429729f8f.0 for ; Sat, 12 Oct 2024 01:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=z1k.dev; s=google; t=1728720137; x=1729324937; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bVLhFD5M1C+SQPQkuOiqKjbu5SicYykP1nlX/LPykmI=; b=K6y/4j9Qri8phQFJFVbDzBgB3s7oCV5KW1lMj+SCbMcdITOy9TtwNxenaHIXNd7rgg 7QAcWY2Svjo7zhEWNWlGr86rcZ48tq0zoM5vdTAn/SbugHbulkApRDWOnvr2OXMFsH2O ca41fxs7SHFabpa5m0fzJGgsZgWbUoWcHWZhT5K9W2d6JpMpzXn5hm49rlYoJ2PVs6jo ZpBpSUEsVlpJaVxwMalukcKlackjbYvjlThlfrhaLs7UYXEVpGB8QJhDk5K0DRH6vq5v bybG8I0eezAs0iVs+bxovcsTicbLMvU5pi4mYl57Klho9LyIGgrHLOBrcRJJIi1qk3Nf ym8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728720137; x=1729324937; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bVLhFD5M1C+SQPQkuOiqKjbu5SicYykP1nlX/LPykmI=; b=nD4n6MKvLgGbZ5J2epiqP8xNSch2MDOlio8MBXVPSXJNCvzVZe53malNUqaXJl04Dx JPepy8ntybPpEqoebkTFpOniy1YyNmoCD/07X4B6Rz1AfF5B77G7kEvD8qDwGurKb3ik kp0I0Jv62IiOjkbTOLFJ2raOCPuiO93X4n8A798NiTMVyStUpJjmdgxp1OIlqyudEsV3 mwSl2DCVAISOFwRUWpfdLk3XkqB1leyR2usJ+R1E0z7zb89cACm5OEAeaNYz8Ooyizf+ wI2lPtK18HW1i2Oo/XZk+FNJ+mmOGi5neX/ITvQG3pkRlta4GdALBc0TMq92n4682XH1 m2Xg== X-Gm-Message-State: AOJu0Yw4CnYoIbHze89lWX3s7kT8V/Iuc/0Pju0A/bArKdJELWWHGUsR rJ6mEn+T1j8cnn/YAnQDEQ7OWxzL6hVFw+JmLHY1DdESUPIeuh3CuxWSPBr5pMnP95hkIQ5YklS IQTMVVTnwGYwxv1uff1Khnrz4C1T7i4MwqeXPUH5Z4WNAtrx1hCBMtdilE7Y= X-Google-Smtp-Source: AGHT+IFLJ096epbH4REWDA7rT7kYG8zGXEqmUIBMpTExufA5N094AI4hg9Qj0fKaD+nlerclBYMWU9+4ypd5mDwvfv8= X-Received: by 2002:a05:6000:1251:b0:374:c1ea:2d40 with SMTP id ffacd0b85a97d-37d4815fa28mr8399470f8f.1.1728720136299; Sat, 12 Oct 2024 01:02:16 -0700 (PDT) MIME-Version: 1.0 From: Yikai Zhao Date: Sat, 12 Oct 2024 16:02:04 +0800 Message-ID: Subject: 30.0.91; (documentation 'pcase) can take several seconds To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=i@blahgeek.com; helo=mail-wr1-x444.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) When `lsp-mode` is loaded, `(documentation 'pcase)` can take several seconds to complete. Apparently, it would iterate over all defined pcase macros (N), and for each of those, `help-fns-short-filename` would iterate over all items in `load-path` (M). Total time complexity is N*M. In my case, N is about ~400 (defined in lsp-protocols.el) and M is about ~100 (I think it's a normal case?). This is especially problematic since the `documentation` method can be invoked by eldoc, which affects the responsiveness during editing. -- Here's my profiler result: 2713 86% - timer-event-handler 2713 86% - apply 2707 86% - # 2707 86% - eldoc-print-current-symbol-info 2707 86% - eldoc--invoke-strategy 2707 86% - eldoc-documentation-default 2707 86% - # 2707 86% - elisp-eldoc-funcall 2707 86% - elisp-get-fnsym-args-string 2707 86% - documentation 2707 86% - pcase--make-docstring 2606 82% - help-fns-short-filename 2598 82% - file-relative-name 335 10% file-remote-p 27 0% string-prefix-p -- In GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2024-09-12 built on 8afcf8f014b8 Repository revision: 9a1c76bf7ff49d886cc8e1a3f360d71e62544802 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.5 LTS Configured using: 'configure --prefix=/work/dist/AppDir --disable-locallisppath --with-native-compilation=aot --with-json --with-threads --with-sqlite3 --with-tree-sitter --with-dbus --with-xml2 --with-modules --with-libgmp --with-gpm --with-lcms2 --with-mps --with-x --without-pgtk --without-gconf --with-x-toolkit=gtk3 --with-xft --without-tiff --without-imagemagick --with-gif --with-png --with-rsvg --with-webp --with-harfbuzz --with-cairo --with-libotf --without-m17n-flt --with-jpeg emacs_cv_jpeglib=/usr/lib/x86_64-linux-gnu/libjpeg.a CPPFLAGS=-I/work/dist/AppDir/include LDFLAGS=-L/work/dist/AppDir/lib' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $EMACSDATA: /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/etc value of $EMACSDOC: /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/etc value of $EMACSLOADPATH: /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp value of $EMACSPATH: /tmp/.mount_emacsXLI1Nd/libexec/emacs/30.0.91/x86_64-pc-linux-gnu value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: sudo-edit-indicator-mode: t evil-vimish-fold-mode: t vimish-fold-mode: t diff-hl-mode: t projectile-mode: t flycheck-posframe-mode: t flycheck-mode: t ligature-mode: t whitespace-mode: t electric-pair-mode: t hl-todo-mode: t dtrt-indent-mode: t windmove-mode: t tempel-abbrev-mode: t company-mode: t global-git-commit-mode: t magit-auto-revert-mode: t hl-line-mode: t display-line-numbers-mode: t recentf-mode: t pixel-scroll-precision-mode: t server-mode: t winner-mode: t global-auto-revert-mode: t save-place-mode: t vertico-mode: t which-key-mode: t global-evil-visualstar-mode: t evil-visualstar-mode: t evil-snipe-override-mode: t evil-snipe-override-local-mode: t evil-owl-mode: t global-evil-surround-mode: t evil-surround-mode: t evil-commentary-mode: t evil-mode: t evil-local-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/yikai/.emacs.d/lib/which-key/which-key hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/which-key /home/yikai/.emacs.d/lib/transient/lisp/transient hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/transient /home/yikai/.emacs.d/lib/editorconfig/editorconfig hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig /home/yikai/.emacs.d/lib/editorconfig/editorconfig-tools hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig-tools /home/yikai/.emacs.d/lib/editorconfig/editorconfig-fnmatch hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig-fnmatch /home/yikai/.emacs.d/lib/editorconfig/editorconfig-core hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig-core /home/yikai/.emacs.d/lib/editorconfig/editorconfig-core-handle hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig-core-handle /home/yikai/.emacs.d/lib/editorconfig/editorconfig-conf-mode hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/editorconfig-conf-mode /home/yikai/.emacs.d/lib/use-package/bind-key hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/bind-key /home/yikai/.emacs.d/lib/use-package/use-package hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package /home/yikai/.emacs.d/lib/use-package/use-package-lint hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-lint /home/yikai/.emacs.d/lib/use-package/use-package-jump hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-jump /home/yikai/.emacs.d/lib/use-package/use-package-ensure hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-ensure /home/yikai/.emacs.d/lib/use-package/use-package-ensure-system-package hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-ensure-system-package /home/yikai/.emacs.d/lib/use-package/use-package-diminish hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-diminish /home/yikai/.emacs.d/lib/use-package/use-package-delight hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-delight /home/yikai/.emacs.d/lib/use-package/use-package-core hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-core /home/yikai/.emacs.d/lib/use-package/use-package-bind-key hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/use-package/use-package-bind-key /home/yikai/.emacs.d/lib/compat/compat hides /tmp/.mount_emacsXLI1Nd/share/emacs/30.0.91/lisp/emacs-lisp/compat Features: (shadow sort mail-extr emacsbug tramp-cmds loadhist doctor devdocs-browser evil-collection-profiler profiler consult-xref evil-collection-shortdoc shortdoc cus-start tabify descr-text evil-collection-view view jka-compr evil-collection-woman woman evil-collection-man man goto-addr magit-extras cl-print printing ps-print ps-print-loaddefs lpr help-fns vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs evil-collection-vc-git vc-git bug-reference magit-bookmark evil-collection-magit magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit evil-collection-package-menu package url-handlers evil-collection-magit-repos magit-repos magit-apply magit-wip magit-log jinja2-mode tramp-cache time-stamp bpftrace-mode expand-region yaml-mode-expansions text-mode-expansions cc-mode-expansions python-el-fgallina-expansions js-mode-expansions html-mode-expansions css-mode-expansions er-basic-expansions expand-region-core expand-region-custom pr-review-search css-mode sgml-mode facemenu evil-collection-eww eww mm-url evil-collection-gnus gnus nnheader range typescript-ts-mode sudo-edit ebuild-mode skeleton autoinsert lsp-haskell haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support flymake-proc evil-collection-flymake flymake etags fileloop generator dabbrev haskell-customize lsp-pyright lsp-mode lsp-protocol spinner lv inline ht evil-vimish-fold vimish-fold f s git-gutter-fringe fringe-helper git-gutter evil-collection-diff-hl diff-hl evil-collection-log-view log-view evil-collection-vc-dir vc-dir ewoc vc vc-dispatcher projectile evil-collection-grep grep ibuf-ext evil-collection-ibuffer ibuffer ibuffer-loaddefs flycheck-posframe posframe flycheck-google-cpplint evil-collection-flycheck flycheck ligature whitespace elec-pair hl-todo dtrt-indent company-keywords company-dabbrev-code company-dabbrev company-files make-mode evil-collection-sh-script sh-script executable evil-collection-cmake-mode cmake-mode rst js c-ts-common evil-collection-yaml-mode yaml-mode vertico-directory windmove tempel company-abbrev company-emoji company-emoji-list company-capf company orderless bazel evil-collection-xref xref which-func testcover evil-collection-edebug edebug evil-collection-debug debug backtrace evil-collection-python python treesit project evil-collection-imenu imenu ffap protobuf-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds jsonnet-mode smie conf-mode url-queue textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check pr-review pr-review-render shr pixel-fill kinsoku url-file svg dom pr-review-action magit-diff smerge-mode diff evil-collection-diff-mode diff-mode track-changes git-commit evil-collection-log-edit log-edit message sendmail yank-media evil-collection-dired dired dired-loaddefs rfc822 mml mml-sec evil-collection-epa epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode transient browse-url benchmark magit-git magit-base crm pr-review-input evil-collection-markdown-mode markdown-mode evil-collection-outline noutline outline mule-util pulse mail-utils network-stream url-cache hl-line display-line-numbers pr-review-notification pr-review-listview pr-review-api ghub-graphql treepy gsexp ghub url-http mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap let-alist gnutls puny pr-review-common evil-collection-magit-section magit-section dash recentf tree-widget wid-edit evil-collection-consult consult cursor-sensor time pixel-scroll cua-base auth-source-pass url-parse url-vars server fcitx dbus xml winner evil-collection-vterm vterm evil-collection-bookmark bookmark pp face-remap evil-collection-compile compile text-property-search evil-collection-term term disp-table ehelp find-func vterm-module term/xterm xterm cc-styles cc-align cc-engine cc-vars cc-defs google-c-style midnight diary-lib diary-loaddefs evil-collection-calendar cal-menu calendar cal-loaddefs autorevert filenotify saveplace tramp-sh tramp trampver tramp-integration files-x tramp-message tramp-compat xdg shell pcomplete evil-collection-comint comint ansi-osc parse-time iso8601 time-date auth-source eieio eieio-core password-cache json map ansi-color tramp-loaddefs cus-load evil-collection-vertico vertico compat solarized-light-theme solarized-theme solarized solarized-faces color evil-collection-which-key which-key fringe-scale switch-buffer-functions evil-visualstar evil-snipe evil-owl format-spec evil-surround evil-commentary evil-commentary-integration evil-collection-tabulated-list evil-collection-tab-bar evil-collection-simple evil-collection-replace evil-collection-process-menu evil-collection-kmacro evil-collection-info evil-collection-indent evil-collection-help evil-collection-elisp-mode evil-collection-eldoc evil-collection-buff-menu evil-collection annalist evil evil-integration evil-maps evil-commands evil-digraphs reveal evil-jumps evil-command-window evil-types evil-search evil-ex evil-macros evil-repeat evil-states evil-core advice evil-common thingatpt rect evil-vars ring edmacro kmacro byte-opt delight comp-run use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core yaml-mode-autoloads xonsh-mode-autoloads with-editor-autoloads which-key-autoloads wgrep-autoloads vterm-autoloads vimrc-mode-autoloads vimish-fold-autoloads vertico-autoloads use-package-autoloads treesit-auto-autoloads treepy-autoloads transient-autoloads tempel-autoloads switch-buffer-functions-autoloads suggest-autoloads sudo-edit-autoloads spinner-autoloads solarized-theme-autoloads s-autoloads rust-mode-autoloads rg-autoloads rainbow-mode-autoloads pydoc-autoloads protobuf-mode-autoloads projectile-autoloads pr-review-autoloads posframe-autoloads popup-autoloads pkg-info-autoloads php-mode-autoloads package-lint-autoloads org2elcomment-autoloads org-tree-slide-autoloads orderless-autoloads markdown-mode-autoloads magit-autoloads lv-autoloads lua-mode-autoloads lsp-pyright-autoloads lsp-mode-autoloads lsp-haskell-autoloads loop-autoloads llama-autoloads ligature-autoloads kotlin-mode-autoloads just-mode-autoloads jsonnet-mode-autoloads jinja2-mode-autoloads ht-autoloads hl-todo-autoloads haskell-mode-autoloads groovy-mode-autoloads gptel-autoloads goto-chg-autoloads google-c-style-autoloads go-mode-autoloads gn-mode-autoloads git-link-autoloads git-gutter-fringe-autoloads git-gutter-autoloads ghub-autoloads fringe-helper-autoloads flycheck-posframe-autoloads flycheck-package-autoloads flycheck-google-cpplint-autoloads flycheck-autoloads fish-mode-autoloads fcitx-autoloads f-autoloads explain-pause-mode-autoloads expand-region-autoloads exec-path-from-shell-autoloads evil-visualstar-autoloads evil-vimish-fold-autoloads evil-surround-autoloads evil-snipe-autoloads evil-owl-autoloads evil-commentary-autoloads evil-collection-autoloads evil-autoloads epl-autoloads epkg-autoloads embark-autoloads emacsql-autoloads emacs-fringe-scale-autoloads editorconfig-autoloads ebuild-mode-autoloads dumb-jump-autoloads dtrt-indent-autoloads dockerfile-mode-autoloads diff-hl-autoloads devdocs-browser-autoloads delight-autoloads dash-autoloads cuda-mode-autoloads copilot-autoloads consult-flycheck-autoloads consult-autoloads compat-autoloads company-emoji-autoloads company-autoloads codeium-autoloads cl-macs cmake-mode-autoloads closql-autoloads bpftrace-mode-autoloads borg-autoloads bazel-autoloads avy-autoloads annalist-autoloads add-node-modules-path-autoloads borg loaddefs-gen generate-lisp-file lisp-mnt radix-tree pcase info comp cl-seq comp-cstr cl-extra help-mode comp-common warnings icons subr-x rx gv cl-loaddefs cl-lib bytecomp byte-compile rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 1185831 1011558) (symbols 48 67125 23) (strings 32 316477 39434) (string-bytes 1 10307989) (vectors 16 123279) (vector-slots 8 2358285 658163) (floats 8 1093 15048) (intervals 56 31071 5410) (buffers 992 56)) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 12 05:22:40 2024 Received: (at 73766) by debbugs.gnu.org; 12 Oct 2024 09:22:40 +0000 Received: from localhost ([127.0.0.1]:36311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szYKd-00084u-PJ for submit@debbugs.gnu.org; Sat, 12 Oct 2024 05:22:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szYKa-00084c-VW for 73766@debbugs.gnu.org; Sat, 12 Oct 2024 05:22:37 -0400 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 1szYKH-0007Cy-CB; Sat, 12 Oct 2024 05:22:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LtXx9cNyDb5xzRrbl76AXOwC9YnWY9fJvXVmHtTcaT0=; b=OuYKHhbszq5KTu/XOq7X L+5fRDMb7btiG7iLcZj8LZz15vX3ez50NmUWqKdLYqH9Sp/PRwJkxphokwckgwZxX6em7sBQnoH06 Tow9TxG76AOprk4uj73jBB7SULZIdd4T4MVb+FhGqb1HqRb8QLnEZ1Urph9QKLIXbKX8he7ifZmn0 1oISrFB0gibBMql7CglimJhFJEUYVwU78RY1GRtMYf9b/vV0hjr6sbf9GpyZZOYvSL9kuT/dFOp6Q Oa0Mz3SShZNXotrU2ecJlIRgzFeyhg9nvylk1taHvFXrkjEaG+KHNXM3epofKJqMccLXJHBHRwAyo IEbzxAbfD377yA==; Date: Sat, 12 Oct 2024 12:22:13 +0300 Message-Id: <86msj9y8u2.fsf@gnu.org> From: Eli Zaretskii To: Yikai Zhao , Stefan Monnier , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: (message from Yikai Zhao on Sat, 12 Oct 2024 16:02:04 +0800) Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yikai Zhao > Date: Sat, 12 Oct 2024 16:02:04 +0800 > > When `lsp-mode` is loaded, `(documentation 'pcase)` can take several > seconds to complete. > > Apparently, it would iterate over all defined pcase macros (N), and for > each of those, `help-fns-short-filename` would iterate over all items in > `load-path` (M). Total time complexity is N*M. > > In my case, N is about ~400 (defined in lsp-protocols.el) and M is about > ~100 (I think it's a normal case?). > > This is especially problematic since the `documentation` method can be > invoked by eldoc, which affects the responsiveness during editing. > > -- > > Here's my profiler result: > > 2713 86% - timer-event-handler > 2713 86% - apply > 2707 86% - # F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12> > 2707 86% - eldoc-print-current-symbol-info > 2707 86% - eldoc--invoke-strategy > 2707 86% - eldoc-documentation-default > 2707 86% - # F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_17> > 2707 86% - elisp-eldoc-funcall > 2707 86% - elisp-get-fnsym-args-string > 2707 86% - documentation > 2707 86% - pcase--make-docstring > 2606 82% - help-fns-short-filename > 2598 82% - file-relative-name > 335 10% file-remote-p > 27 0% string-prefix-p Adding Stefan and João, in case they have some comments or suggestions. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 12 12:40:04 2024 Received: (at 73766) by debbugs.gnu.org; 12 Oct 2024 16:40:05 +0000 Received: from localhost ([127.0.0.1]:53086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szf9v-0003Jn-MY for submit@debbugs.gnu.org; Sat, 12 Oct 2024 12:40:04 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szf9t-0003Ix-4s for 73766@debbugs.gnu.org; Sat, 12 Oct 2024 12:40:02 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BD2218076B; Sat, 12 Oct 2024 12:39:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1728751179; bh=sKAx18kat01v3sf5bvmQzsEk+UgmRzvdUGr1rVYN4lQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pBAruOYRy5SiwxHVAoIDIce3TpoCLGPOzbdGh0EQaDlYZUpTGH4QXjjVuTbHU5QNY cAz94n86VSwZ7L6zsK14pbb5W6oI7NOc7avwU/yglQENakqE9QdSkyVEqImR1F/sLZ vozL/io3NMBd2WdAG6OFhhkM5v/bfz0G4pzaBglDVvVLXwOurKKVz5Cef9SRqbpVvY F1sm5yIL+t/V4FfOO1cSlXi+wXKQRRaP+6m8+ucZpTlUoupti+BEkCrQpLsDWrYSuE l9LPZJ76vAYLdgn73cLevbWV3VDGvHNmYxydKmcUj5N35DAX/hjvSgTV9Yd37nIcO/ BPG4GQS7c39Rg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AF599807A8; Sat, 12 Oct 2024 12:39:39 -0400 (EDT) Received: from pastel (104-195-209-82.cpe.teksavvy.com [104.195.209.82]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E7F912046C; Sat, 12 Oct 2024 12:39:39 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: <86msj9y8u2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Oct 2024 12:22:13 +0300") Message-ID: References: <86msj9y8u2.fsf@gnu.org> Date: Sat, 12 Oct 2024 12:39:38 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, Yikai Zhao , =?windows-1252?B?Sm/jbyBU4XZvcmE=?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >> Apparently, it would iterate over all defined pcase macros (N), and for >> each of those, `help-fns-short-filename` would iterate over all items in >> `load-path` (M). Total time complexity is N*M. > Adding Stefan and Jo=E3o, in case they have some comments or > suggestions. How 'bout a patch like the one below? Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=shortenfile.patch diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 3f64b2e126f..3e0973c25ee 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1090,17 +1090,38 @@ help-fns--mention-shortdoc-groups (fill-region-as-paragraph (point-min) (point-max)) (goto-char (point-max)))))) +(require 'radix-tree) + +(defconst help-fns--radix-trees + (make-hash-table :weakness 'key :test #'equal)) + +(defun help-fns--radix-tree (dirs) + (with-memoization (gethash dirs help-fns--radix-trees) + (let ((rt radix-tree-empty)) + (dolist (d dirs) + (let ((d (abbreviate-file-name + (file-name-as-directory (expand-file-name d))))) + (setq rt (radix-tree-insert rt d t)))) + rt))) + (defun help-fns-short-filename (filename) - (let* ((abbrev (abbreviate-file-name filename)) - (short abbrev)) - (dolist (dir load-path) - (let ((rel (file-relative-name filename dir))) - (if (< (length rel) (length short)) - (setq short rel))) - (let ((rel (file-relative-name abbrev dir))) - (if (< (length rel) (length short)) - (setq short rel)))) - short)) + (let* ((short (abbreviate-file-name (expand-file-name filename))) + (dir (file-name-directory short)) + (nondir (file-name-nondirectory short)) + (rt (help-fns--radix-tree load-path)) + (prefixes (radix-tree-prefixes rt dir))) + (if (not prefixes) + ;; The file is not inside the `load-path'. + ;; FIXME: We used to try and shorten it with "../". + ;; (dolist (dir load-path) + ;; (let ((rel (file-relative-name filename dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel))) + ;; (let ((rel (file-relative-name abbrev dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel)))) + short + (file-relative-name short (caar prefixes))))) (defun help-fns--analyze-function (function) ;; FIXME: Document/explain the differences between FUNCTION, --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 13 10:11:54 2024 Received: (at 73766) by debbugs.gnu.org; 13 Oct 2024 14:11:54 +0000 Received: from localhost ([127.0.0.1]:51999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szzK6-00058e-Gl for submit@debbugs.gnu.org; Sun, 13 Oct 2024 10:11:54 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:45365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szzK3-00058V-PY for 73766@debbugs.gnu.org; Sun, 13 Oct 2024 10:11:52 -0400 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-37d4c1b1455so2415349f8f.3 for <73766@debbugs.gnu.org>; Sun, 13 Oct 2024 07:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=z1k.dev; s=google; t=1728828635; x=1729433435; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Df4WoKeSxRDymxRTda837mPpjrihgczqrSaXj0SlXuY=; b=esfytqUsI1AerO/tnjz+GX+Cl9vaxNuOPYJxkVYaQ4tdwymbGuzwjai00+XZLmJNHv WXf4jo5ebbLoYkAIFQoSny3gDPrKNNnuFiCoBiBv24E+JcHPlv0hOcFchcRpOTJqBkmz Dw0+C6LlgXx6nKTm6M8BQ5BuBv9/J0H/6lksv4e0NnFCK4CVWwUrHMvPEhHaPPolNLzE 1oxY9dYB0a7bGdodtJ/CFKLLM3lPKa5nk6xrBuyiNL6m+lFxF1bT/7kN2wOaXwbS2wrQ zldfIA5jICYWqycKiqYOu3xSye01udrb315ACyM/Xw73PquUvg0SE07EXFlt91jvefp4 +jfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728828635; x=1729433435; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Df4WoKeSxRDymxRTda837mPpjrihgczqrSaXj0SlXuY=; b=wnaZzSWFunq+ceNv1UcryPsuABDuM6Se4tDL5FlEgI3MkxkgzM8bvBaYLtacazFzBK /ZMRocSAgwp8UbnjGa0TXha+Osq0sc/M66hJY5tim1R+TISl5guZnD5ksd7hCb27LEGG QixGUiXybt96Vx+xXwnINE4sVzyFU0/QN+N5j2WmzYxcBJR8b6dIWDKxHeeqPCerNSyq vf9CiR0GBxgyG4E5yQh14bBQH0q2menDdCsqDKz4gs2Ziv/aBIxlzlXixI2NAu14Esu2 O40j4knZbSiah+MBheTadvHs2W9w+E1pXndI6JShKFQnrImDiJ1sZBxr0P+J8evvwiQp oU9Q== X-Forwarded-Encrypted: i=1; AJvYcCVKizFT0BFq877H1bdvqcndkFvfvrOYkNNIKS8VgCdoF2W5PFQQKedWOfrd54cwXvqG44D50A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YycyLcvgvh7vfFHEE6F/KBisC2ANbYGvyjMV60Bjp4EPlGa6oE/ aGotI1roqgBA4DiW84u2H6KCil4doLvVUKEA7BhiCfUjsPR+soYwuItMQBwkT3K8tBf+Tr0aVm1 cO0ga3YBrrtOXbPcshlD9ehk7a6P/XfBqc8Vvxw== X-Google-Smtp-Source: AGHT+IH0pNQF4bSRCHDcmBWr6jfosPUc3pu15WH5oMKPZfPrLg0qR1MqCLO7ZqJLgFxVNwKDNEZhLsvyIs5OoYCQRoQ= X-Received: by 2002:adf:ef11:0:b0:37d:4610:dc5 with SMTP id ffacd0b85a97d-37d55262d68mr6077054f8f.44.1728828635347; Sun, 13 Oct 2024 07:10:35 -0700 (PDT) MIME-Version: 1.0 References: <86msj9y8u2.fsf@gnu.org> In-Reply-To: From: Yikai Zhao Date: Sun, 13 Oct 2024 22:10:24 +0800 Message-ID: Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73766 Cc: Eli Zaretskii , 73766@debbugs.gnu.org, =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On Sun, Oct 13, 2024 at 12:39=E2=80=AFAM Stefan Monnier wrote: > > >> Apparently, it would iterate over all defined pcase macros (N), and fo= r > >> each of those, `help-fns-short-filename` would iterate over all items = in > >> `load-path` (M). Total time complexity is N*M. > > Adding Stefan and Jo=C3=A3o, in case they have some comments or > > suggestions. > > How 'bout a patch like the one below? Hello, I tried this patch and can confirm it improves the performance. Here's the result of (benchmark-run (documentation 'pcase)): - master: 4s - master with this patch: 0.12s However it's still slower than last stable version: - 29.4 version: 0.02s Yikai From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 17 13:22:38 2024 Received: (at 73766) by debbugs.gnu.org; 17 Oct 2024 17:22:38 +0000 Received: from localhost ([127.0.0.1]:35479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1UCo-0002Ok-Di for submit@debbugs.gnu.org; Thu, 17 Oct 2024 13:22:38 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1UCj-0002OT-P7 for 73766@debbugs.gnu.org; Thu, 17 Oct 2024 13:22:33 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0CDEA441559; Thu, 17 Oct 2024 13:22:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729185721; bh=NafECKYfdwr4uHzaEabrBrNeNORiWCy3tXH4cU7VELY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=L0PmgED6ATwTBrZgh6RpG7lmFszuIFaOx3CTcZtSdfyUiMP1DoFh0lGkemvUfPjwi JNjPbA4e9i0VislJnBBX5H/0r72IjOhwBRux60Ecj7NglGGkWL6xzEwCk/VbTfrl8x +/qMHS04MUR7jpHAnY5GUiX8vJPjg4t/WZOAEOX8cDYEsv29Ly122BV0W7QuxOcsqh aU6K3CvcNlGkLbbwYZSYQZevRFJXhPKmhWuIN35glznr+/2bVRNlg6oHFnA0UHp52I u9zN5L7qEfpeRInx4K7qT23fedfIt43wJliZm2rK5/HpBXWhwNZxXe7wGj9/xHRt1k XACtWN7p+Wf2w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C8A0A441407; Thu, 17 Oct 2024 13:22:01 -0400 (EDT) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A99CA120588; Thu, 17 Oct 2024 13:22:01 -0400 (EDT) From: Stefan Monnier To: Yikai Zhao Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: (Yikai Zhao's message of "Sun, 13 Oct 2024 22:10:24 +0800") Message-ID: References: <86msj9y8u2.fsf@gnu.org> Date: Thu, 17 Oct 2024 13:22:00 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: Eli Zaretskii , 73766@debbugs.gnu.org, =?windows-1252?B?Sm/jbyBU4XZvcmE=?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> >> Apparently, it would iterate over all defined pcase macros (N), and f= or >> >> each of those, `help-fns-short-filename` would iterate over all items= in >> >> `load-path` (M). Total time complexity is N*M. >> > Adding Stefan and Jo=C3=A3o, in case they have some comments or >> > suggestions. >> How 'bout a patch like the one below? > I tried this patch and can confirm it improves the performance. > Here's the result of (benchmark-run (documentation 'pcase)): > - master: 4s > - master with this patch: 0.12s Thanks =F0=9F=99=82 Wli, this is a non-trivial chunk of code and it's used more often than just to get the docstring of `pcase`, so I'm clearly not obviously safe for `emacs-30`. Here are some options I can think of: - Install it `emacs-30` anyway. - Revert on `emacs-30` the change that introduced the slowdown: commit 052c2ce0284c5193c9d6768a45a9b3508af51230 Author: Stefan Monnier Date: Sun Feb 11 17:43:37 2024 -0500 (pcase): Add buttons to the macros' defs in the docstring of `pcase` * lisp/emacs-lisp/pcase.el (pcase--find-macro-def-regexp): New var. (find-function-regexp-alist): Add entry for `pcase-macro`s. (help-fns--signature): Move declaration to where we know it is vali= d. (pcase--make-docstring): Add buttons to jump to the definition of Pcase macros. - Install on `emacs-30` a simpler and more focused change, which should work acceptably in most cases, such as: diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 5a7f3995311..811d42793cd 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -214,7 +214,7 @@ pcase--make-docstring (save-excursion (forward-char -1) (insert (format-message " in `")) - (help-insert-xref-button (help-fns-short-filename file= name) + (help-insert-xref-button (file-name-nondirectory filen= ame) 'help-function-def symbol fil= ename 'pcase-macro) (insert (format-message "'.")))) > However it's still slower than last stable version: > - 29.4 version: 0.02s Slower than 29.4 is expected because it gives more information (the file name, as a hyperlink). I think for `C-h o` this plenty fast. There's still a remaining performance issue for things like `eldoc-mode`, admittedly where we'd really want it to be instantaneous, but I think this should be fixed by making `eldoc` call `documentation` in a special way to skips those useless computations (eldoc just wants a "short doc" anyway). This affects other functions using the `function-documentation` property in a similar way. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 17 21:23:30 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 01:23:30 +0000 Received: from localhost ([127.0.0.1]:36432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1biD-0007yX-L7 for submit@debbugs.gnu.org; Thu, 17 Oct 2024 21:23:29 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1biB-0007y3-V3 for 73766@debbugs.gnu.org; Thu, 17 Oct 2024 21:23:28 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 12493100055; Thu, 17 Oct 2024 21:23:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729214579; bh=uSgpZdn+/RAjOc9VJKIkdAVw63zgDpcgtu3pe0PYyMU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fyLEn+SrcmFsdQJMV2pV9bUwK8cHkrSHyJX0JYuL303FXSosuvho7M9G05bCyEqHo dajL+qudx8UchvqJrt7Jz5aNCRof1VH8pgHf7srjH3Zv265/sazoocqycLtw0x59nY ZqlMyHxV58zw6pAro0vdrUwAj1qZdvFV6L346KDgIf9j74kBsk6dP70JTsG+85dmVV 7qz1gOsWnnycQ7uOZ9oDv2Kc9XDNt+C3XpRLNARvfXkLPOQDoKB6fP7zBFOssqgp1z TA5VcC15UZjVAtO89K6QXcniI8pnc77iUqR0+aR7PptkgZ+u7iPriahZq+bypQxPXO AaWxTeguqC6Mg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0D09E100042; Thu, 17 Oct 2024 21:22:59 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CA739120234; Thu, 17 Oct 2024 21:22:58 -0400 (EDT) From: Stefan Monnier To: Yikai Zhao Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: (Stefan Monnier's message of "Thu, 17 Oct 2024 13:22:00 -0400") Message-ID: References: <86msj9y8u2.fsf@gnu.org> Date: Thu, 17 Oct 2024 21:22:58 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.083 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: Eli Zaretskii , 73766@debbugs.gnu.org, =?windows-1252?B?Sm/jbyBU4XZvcmE=?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Wli, this is a non-trivial chunk of code and it's used more often than ^^^ Eli Boy, my typing is getting worse by the day. Sometimes I wonder is my brain is turning to mush. At least for the above blunder, `e` is right next to `w` on my keyboard, so there is some kind of "logic" to it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 01:58:04 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 05:58:04 +0000 Received: from localhost ([127.0.0.1]:36738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1fzw-0003vD-1V for submit@debbugs.gnu.org; Fri, 18 Oct 2024 01:58:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1fzu-0003uZ-3s for 73766@debbugs.gnu.org; Fri, 18 Oct 2024 01:58:02 -0400 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 1t1fzS-0002HS-Ad; Fri, 18 Oct 2024 01:57:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=4gDscOeLsd4WpYp3TvVVJa93pW3rcOihkD8zG2ua878=; b=gPED+5/6rXKX4+WqOHWk kHwb6kVYmtw2ONj9N9BnqMYuyV+oWQrPzWoanzTI8WTVjYrLW3coc85+Rx0BpaD/H994zSzdT/o/f mF4gvcUsMTBHzREh3hhpXHcAzTFyJDQkjaCJm3epXBzQMoxBBRjAgFXabhU3h+JKqa7UH8ZEjILyP jPB+EtjIfXn5cHWVJxsvg5D9tUeVYHTUCRNpP2LTWhMU+wyEP53vK1GqBSRFd1aXQQM+e1PZf9bZz Wy9RG1p+dJW/QHIJvFmX1zy4I1zRlB2PPdOLOyZ7q1qrHyE66RL8tk+p90/iYB1HQiOcL03UTY8mx KRCmZYTFCqb97A==; Date: Fri, 18 Oct 2024 08:57:32 +0300 Message-Id: <86o73ineb7.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Thu, 17 Oct 2024 21:22:58 -0400) Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds References: <86msj9y8u2.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , João Távora > , > 73766@debbugs.gnu.org > Date: Thu, 17 Oct 2024 21:22:58 -0400 > > > Wli, this is a non-trivial chunk of code and it's used more often than > ^^^ > Eli > > Boy, my typing is getting worse by the day. Sometimes I wonder is my > brain is turning to mush. At least for the above blunder, `e` is right > next to `w` on my keyboard, so there is some kind of "logic" to it. Your simple cypher was successfully decoded here ;-) From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 03:09:20 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 07:09:20 +0000 Received: from localhost ([127.0.0.1]:36835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1h6q-0007Bw-Tz for submit@debbugs.gnu.org; Fri, 18 Oct 2024 03:09:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1h6m-0007Bh-5g for 73766@debbugs.gnu.org; Fri, 18 Oct 2024 03:09:15 -0400 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 1t1h6J-0001A5-Ky; Fri, 18 Oct 2024 03:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oZIFiMfKKyAWGvKTu+jm8S+xnxNGInqfLhaltTtafXE=; b=fWdqIS8hfiyeWMZ/d9HB nKQ2x2eziOQEIcAfAPGwMH0ngW/GHg/JcNYOJX7TXXMBz4yDv5RXSGp1webVLSx7rcK3DfDTYdMGD V7tp+wnvPrbo0mXiIChKtolUVrkYJtymNlZRGsm+5xiIojkJ1qrzLTB8c8BgYSSCnXdaqOeowGXE7 J2t5m2slA0+++06fxPuokZAfaE0K7Vdfp3z5bdJXdmQs1DIrTAtCaOTSecmKWp/d1Jl7evePatjpT CWTVngQ8s0ACo4aG7I8a7GWDJhGJ69nGgU5FETgn876FNqZZbi/1mjis/bMx/8Y0VXD5GshHzvZxF gFU/6hqXUyIqfg==; Date: Fri, 18 Oct 2024 10:08:41 +0300 Message-Id: <86cyjxopl2.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Thu, 17 Oct 2024 13:22:00 -0400) Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds References: <86msj9y8u2.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , João Távora > , > 73766@debbugs.gnu.org > Date: Thu, 17 Oct 2024 13:22:00 -0400 > > Eli, this is a non-trivial chunk of code and it's used more often than > just to get the docstring of `pcase`, so I'm clearly not obviously safe > for `emacs-30`. > > Here are some options I can think of: > > - Install it `emacs-30` anyway. > - Revert on `emacs-30` the change that introduced the slowdown: > > commit 052c2ce0284c5193c9d6768a45a9b3508af51230 > Author: Stefan Monnier > Date: Sun Feb 11 17:43:37 2024 -0500 > > (pcase): Add buttons to the macros' defs in the docstring of `pcase` > > * lisp/emacs-lisp/pcase.el (pcase--find-macro-def-regexp): New var. > (find-function-regexp-alist): Add entry for `pcase-macro`s. > (help-fns--signature): Move declaration to where we know it is valid. > (pcase--make-docstring): Add buttons to jump to the definition > of Pcase macros. > > - Install on `emacs-30` a simpler and more focused change, which should > work acceptably in most cases, such as: > > diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el > index 5a7f3995311..811d42793cd 100644 > --- a/lisp/emacs-lisp/pcase.el > +++ b/lisp/emacs-lisp/pcase.el > @@ -214,7 +214,7 @@ pcase--make-docstring > (save-excursion > (forward-char -1) > (insert (format-message " in `")) > - (help-insert-xref-button (help-fns-short-filename filename) > + (help-insert-xref-button (file-name-nondirectory filename) > 'help-function-def symbol filename > 'pcase-macro) > (insert (format-message "'.")))) I'd prefer the last alternative for emacs-30, but then you say: > There's still a remaining performance issue for things like > `eldoc-mode`, admittedly where we'd really want it to be instantaneous, > but I think this should be fixed by making `eldoc` call `documentation` > in a special way to skips those useless computations (eldoc just wants > a "short doc" anyway). This affects other functions using the > `function-documentation` property in a similar way. Does it mean that this slowdown of eldoc was also caused by commit 052c2ce0284c5193c9d6768a45a9b3508af51230, and if so, does the patch you've shown previously (and which you consider not safe enough for emacs-30) solve the eldoc slowdown as well? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 13:05:35 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 17:05:35 +0000 Received: from localhost ([127.0.0.1]:39899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1qPu-0001RK-Qs for submit@debbugs.gnu.org; Fri, 18 Oct 2024 13:05:35 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1qPs-0001Pp-Qh for 73766@debbugs.gnu.org; Fri, 18 Oct 2024 13:05:33 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 83B434411C8; Fri, 18 Oct 2024 13:05:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729271101; bh=ly4c3DQn++u9NZcLvZ34K40PBXa6ieEfSkBZ7ooJQcA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=V/IDfaPwFnl3K90LowlK9Dx+1KqbrepVCKXoZRqNuGctXNQgfkDBSmZErSPkmd4kP 80nhlODCUA3+ccbJQ/P6ZWuRDoiU5UIW5yd76ITFdbNZQmXCUiw3FZUrrGNQY9IO6i 5J3W7INCntwXedr32MeuKpcVNjm6cHU8KEaWLbe6pj1YNlKjTNykZ0Yt6HKqQtG8lL 9qnvFqOtNVa9ag59xCbduAg/IdJzhZcynfYajNpsWjpA6miR1Lg1rRg3D+UvcnkYGA L9JUkuFnaMOJmZSr9OuNSUPaiI29nWJ/j75JuSHEpI07ZymiNdJPPNrTt4VY3amWWp eBVOJ4PzCnYJg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6BE8B441766; Fri, 18 Oct 2024 13:05:01 -0400 (EDT) Received: from alfajor (modemcable031.210-178-173.mc.videotron.ca [173.178.210.31]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34CF312032C; Fri, 18 Oct 2024 13:05:01 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: <86cyjxopl2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Oct 2024 10:08:41 +0300") Message-ID: References: <86msj9y8u2.fsf@gnu.org> <86cyjxopl2.fsf@gnu.org> Date: Fri, 18 Oct 2024 13:04:54 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.062 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el >> index 5a7f3995311..811d42793cd 100644 >> --- a/lisp/emacs-lisp/pcase.el >> +++ b/lisp/emacs-lisp/pcase.el >> @@ -214,7 +214,7 @@ pcase--make-docstring >> (save-excursion >> (forward-char -1) >> (insert (format-message " in `")) >> - (help-insert-xref-button (help-fns-short-filename filename) >> + (help-insert-xref-button (file-name-nondirectory filename) >> 'help-function-def symbol filename >> 'pcase-macro) >> (insert (format-message "'.")))) > > I'd prefer the last alternative for emacs-30, but then you say: Thanks, will do. >> There's still a remaining performance issue for things like >> `eldoc-mode`, admittedly where we'd really want it to be instantaneous, >> but I think this should be fixed by making `eldoc` call `documentation` >> in a special way to skips those useless computations (eldoc just wants >> a "short doc" anyway). This affects other functions using the >> `function-documentation` property in a similar way. > Does it mean that this slowdown of eldoc was also caused by commit > 052c2ce0284c5193c9d6768a45a9b3508af51230, and if so, does the patch > you've shown previously (and which you consider not safe enough for > emacs-30) solve the eldoc slowdown as well? What I meant is that the 4s slowdown affects both `C-h f` and eldoc, and that the patch I sent which reduces it to 0.12s is IMO sufficient for the `C-h f` case but may still make Emacs feel occasionally a bit sluggish when eldoc hits this 0.12s. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 14:35:40 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 18:35:40 +0000 Received: from localhost ([127.0.0.1]:40033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1rp6-0005ch-4Y for submit@debbugs.gnu.org; Fri, 18 Oct 2024 14:35:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1rp4-0005bQ-1o for 73766@debbugs.gnu.org; Fri, 18 Oct 2024 14:35:39 -0400 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 1t1roa-0003OO-Jv; Fri, 18 Oct 2024 14:35:08 -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=NpVdeFzyMcFQZwJ2AdBv4eaK2JfreJuxZzJQKFF5fNE=; b=XPyc35KIreKL YeOwUT0Vf5Kw3WpFDhHkLYuUu3zJuMgC2tU6j3Ay6ge709jcnr+mxworLtIaWOoX+vnvT0zfiaOKE hujnAwfQUD2tQHGF47vvhcjvHaI7n9+HFh5+iLdwCgaSanwTBRYTrK1LrIwfea9s1Wx9qlMJKZ608 2WWbhfLzemjwf8eaVjFNHIr1SEGulBqQtcUF3qWX9MbKBU4NvfjKouyOCKXvrOL2amP5d4sSXYdmh GeoVBYAM2SRjKAnsiZm0FWzQY/aQXXDs7Pij0c6iSmmW6bkdyRmMZO3G4GZGfmvbANW7GZrjBy0in zp0NxfpGiv3dDWuPzY1fuA==; Date: Fri, 18 Oct 2024 21:35:05 +0300 Message-Id: <86msj1mf8m.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Fri, 18 Oct 2024 13:04:54 -0400) Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds References: <86msj9y8u2.fsf@gnu.org> <86cyjxopl2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: yikai@z1k.dev, joaotavora@gmail.com, 73766@debbugs.gnu.org > Date: Fri, 18 Oct 2024 13:04:54 -0400 > > > I'd prefer the last alternative for emacs-30, but then you say: > > Thanks, will do. > > >> There's still a remaining performance issue for things like > >> `eldoc-mode`, admittedly where we'd really want it to be instantaneous, > >> but I think this should be fixed by making `eldoc` call `documentation` > >> in a special way to skips those useless computations (eldoc just wants > >> a "short doc" anyway). This affects other functions using the > >> `function-documentation` property in a similar way. > > Does it mean that this slowdown of eldoc was also caused by commit > > 052c2ce0284c5193c9d6768a45a9b3508af51230, and if so, does the patch > > you've shown previously (and which you consider not safe enough for > > emacs-30) solve the eldoc slowdown as well? > > What I meant is that the 4s slowdown affects both `C-h f` and eldoc, > and that the patch I sent which reduces it to 0.12s is IMO sufficient > for the `C-h f` case but may still make Emacs feel occasionally a bit > sluggish when eldoc hits this 0.12s. If the slowdown of eldoc is significant, maybe we will be better with reverting the change which introduced the regression on emacs-30, and then solving on master with your more thorough fix. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 16:43:16 2024 Received: (at 73766) by debbugs.gnu.org; 18 Oct 2024 20:43:16 +0000 Received: from localhost ([127.0.0.1]:40235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1toa-0003Kj-0t for submit@debbugs.gnu.org; Fri, 18 Oct 2024 16:43:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1toV-0003KR-9J for 73766@debbugs.gnu.org; Fri, 18 Oct 2024 16:43:14 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 909C31000C3; Fri, 18 Oct 2024 16:42:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729284161; bh=VxlJi+XKFCa1tbmSP64tdJgH6qY6934MxI/cagEg4yU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=leCXrBZx2Cb20AClxWrRwxLxkNTNQYXdQEnaKZ7sYOP1HJnAl8DFhS0vb8gwu9enG ogqwQHG61Cezjz3+b7hqgEjYekxVdmiAIUayz4Dt0efjZ7NQkOhqRfCWkVAiz3oUVf wSzAjwQQetSlLwmoW4o925ltkH4lJtYPeVax9k0ZUQyU50rOQ+8mMwWlGgM5lPNns4 dXaJ/3n5dfmV7Oscf0eDSwZ8obPjtYulcNku6DOwpm5oM7NRmJ0rR8Dm0p5lyp+wVj U9bFpGqLYftDZy49qr0OMO9glslK9tXoT0zmOoEffEMHc9ufHVcuCLDZDLJrGFddDV 2npvvppd17fkQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C6CAF10002E; Fri, 18 Oct 2024 16:42:41 -0400 (EDT) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A078E12077F; Fri, 18 Oct 2024 16:42:41 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: <86msj1mf8m.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Oct 2024 21:35:05 +0300") Message-ID: References: <86msj9y8u2.fsf@gnu.org> <86cyjxopl2.fsf@gnu.org> <86msj1mf8m.fsf@gnu.org> Date: Fri, 18 Oct 2024 16:42:32 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> >> There's still a remaining performance issue for things like >> >> `eldoc-mode`, admittedly where we'd really want it to be instantaneous, >> >> but I think this should be fixed by making `eldoc` call `documentation` >> >> in a special way to skips those useless computations (eldoc just wants >> >> a "short doc" anyway). This affects other functions using the >> >> `function-documentation` property in a similar way. >> > Does it mean that this slowdown of eldoc was also caused by commit >> > 052c2ce0284c5193c9d6768a45a9b3508af51230, and if so, does the patch >> > you've shown previously (and which you consider not safe enough for >> > emacs-30) solve the eldoc slowdown as well? >> >> What I meant is that the 4s slowdown affects both `C-h f` and eldoc, >> and that the patch I sent which reduces it to 0.12s is IMO sufficient >> for the `C-h f` case but may still make Emacs feel occasionally a bit >> sluggish when eldoc hits this 0.12s. > > If the slowdown of eldoc is significant, maybe we will be better with > reverting the change which introduced the regression on emacs-30, > and then solving on master with your more thorough fix. The "quickfix" I installed on `emacs-30` should not suffer from a significant slowdown, no, so I think we're good for `emacs-30`. The "better" fix I installed on `master`, may still cause a bit of sluggishness with eldoc, OTOH. I think the "right" fix for that is to extend `documentation` or `C-h f` such that the `pcase` doc can distinguish between the (quick to generate) doc about `pcase` itself and the table of Pcase patterns defined with `pcase-defmacro` which is appended to the end of the `pcase` doc (and which can take a bit of time to generate but is not needed for eldoc). It would also be good to be able to show the table in a kind of abbreviated form (one line per Pcase pattern) with a way to unfold/refold specific patterns' doc. The same applies to the list of methods displayed in the doc of generic functions and in the doc of types. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 06:49:14 2024 Received: (at 73766) by debbugs.gnu.org; 27 Oct 2024 10:49:14 +0000 Received: from localhost ([127.0.0.1]:44016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t50pe-0007Cd-6j for submit@debbugs.gnu.org; Sun, 27 Oct 2024 06:49:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t50pc-0007CP-C3 for 73766@debbugs.gnu.org; Sun, 27 Oct 2024 06:49:12 -0400 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 1t50ox-0006X6-Hz; Sun, 27 Oct 2024 06:48:31 -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=faIcXGqoDYAVeoUG7EMMz14+09hI3ztazQd93mb4V68=; b=BhTuAsWnjd37 X/PaKcAVGn3zHUxQly3PcXmz7sqQdPs6t3qy9yyzsVmfhiUWedHN4AQ3vl3iygGViCrfS1bfb+YnJ FXy7mH0HK9v1w2E34QF27/R77PFhEyO6Xiw7sJZLr5QvMQwtq/zXkGxL8ZP8UB2TfGSbBAqVbtOQ4 6n07A2r6+PBFT4ZcQ/wVQ4krPdfgPPdH5Orr24uxG9kdfPzxv/cx/nOqzfvQwcBe7sbPh51w87lNT Xd6HLt9Ca3hwrF1Dh1mGuTYOM8pQAVgLcQeGvxerNPVpGCaDU+ElQF6kX44KJPa3nI/lK47oli0j9 2IaYkUegwL45Bwr2Ny3JsA==; Date: Sun, 27 Oct 2024 12:48:29 +0200 Message-Id: <868qu9akjm.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Fri, 18 Oct 2024 16:42:32 -0400) Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds References: <86msj9y8u2.fsf@gnu.org> <86cyjxopl2.fsf@gnu.org> <86msj1mf8m.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766 Cc: 73766@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: yikai@z1k.dev, joaotavora@gmail.com, 73766@debbugs.gnu.org > Date: Fri, 18 Oct 2024 16:42:32 -0400 > > The "quickfix" I installed on `emacs-30` should not suffer from > a significant slowdown, no, so I think we're good for `emacs-30`. > > The "better" fix I installed on `master`, may still cause a bit of > sluggishness with eldoc, OTOH. > > I think the "right" fix for that is to extend `documentation` or `C-h f` > such that the `pcase` doc can distinguish between the (quick to > generate) doc about `pcase` itself and the table of Pcase patterns > defined with `pcase-defmacro` which is appended to the end of the > `pcase` doc (and which can take a bit of time to generate but is not > needed for eldoc). > > It would also be good to be able to show the table in a kind of > abbreviated form (one line per Pcase pattern) with a way to > unfold/refold specific patterns' doc. > > The same applies to the list of methods displayed in the doc of generic > functions and in the doc of types. Should we now close this bug? From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 10:29:34 2024 Received: (at 73766-done) by debbugs.gnu.org; 27 Oct 2024 14:29:34 +0000 Received: from localhost ([127.0.0.1]:45871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54Gr-0001BO-Ry for submit@debbugs.gnu.org; Sun, 27 Oct 2024 10:29:34 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54Gk-0001B4-EI for 73766-done@debbugs.gnu.org; Sun, 27 Oct 2024 10:29:30 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E0E8B100180; Sun, 27 Oct 2024 10:28:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730039321; bh=Q1U9PLWAw0KF66h5qkfm74AYmWm0xECpRkmKoBlmUkM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hP6azEhgBjy5yZXh8DrZ11JY6coiFfjNmRu85J33xphKfVTm0KPVmOlgHslioqpvq rnZA+Yspw4qPVx8VGPkdzdBbtTzD0OzhkUldnmrFsgMDHMePxfcObMRjL977uhyMIp 6nXVgD/0gXBu9+APBzKTOgzXwrs/FzhP9oezw0qxT8Ylu7TL/3ngO+3P4q0LDQl53b Ekc5PP7y5nxOi/3+htpDU+KL9Cl9wP9601DJc/u42bi+PKvQwcYQ/0GwR70+uEIvut RfVrk6vHUtcSO7BVDWJx0yMJ33o1XIHAz2TFUvD1n7ul3MN+74Qt5al/vsWXGLwKSf JiSBiqat4dBEg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0E4B3100043; Sun, 27 Oct 2024 10:28:41 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CD5AF12046C; Sun, 27 Oct 2024 10:28:40 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds In-Reply-To: <868qu9akjm.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Oct 2024 12:48:29 +0200") Message-ID: References: <86msj9y8u2.fsf@gnu.org> <86cyjxopl2.fsf@gnu.org> <86msj1mf8m.fsf@gnu.org> <868qu9akjm.fsf@gnu.org> Date: Sun, 27 Oct 2024 10:28:39 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.047 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73766-done Cc: 73766-done@debbugs.gnu.org, yikai@z1k.dev, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Should we now close this bug? Yes! Stefan From unknown Sat Sep 20 12:59:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 25 Nov 2024 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator