From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Chen Bin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 55729@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165392199810235 (code B ref -1); Mon, 30 May 2022 14:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 May 2022 14:46:38 +0000 Received: from localhost ([127.0.0.1]:45720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgfF-0002f0-UJ for submit@debbugs.gnu.org; Mon, 30 May 2022 10:46:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:37516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgfE-0002et-MM for submit@debbugs.gnu.org; Mon, 30 May 2022 10:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvgfC-0001sn-Bw for bug-gnu-emacs@gnu.org; Mon, 30 May 2022 10:46:36 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:36503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvgf8-00036n-2a for bug-gnu-emacs@gnu.org; Mon, 30 May 2022 10:46:31 -0400 Received: by mail-pg1-x529.google.com with SMTP id j191so3093777pgd.3 for ; Mon, 30 May 2022 07:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=VN4xU38c2Socn2ZYdTwvv5SFmuKG+B2ulpnFYXTNe84=; b=lWwraJNX5lmtM0hTgyheIkxOoyuzCAt16hoUPGl+q8qOBuEkJL8oHsC75HG2AM3x1U jbNFFdCg6RtrsmQlycwQBbA7qrkDYuS+6xJ4FzUhFYjz2fqNk998b6NfQYnNOcmuzA/f WckyCFVU+beEdM8Mba0ZvVi5QqVs1WcIAc57h2sc/L5Fez0qNllaeBfRnZ14yirNBeY0 IaxbJuMmbFxR+8kSZXXECWxqRLsyttJXXribN4I6W8lnXGFBLLh+PA9sOEjd7uIUTqS/ Vq3gKjSEzYewIXV68TTkHexg1N1EkHSO1W0jnavIYjOgLRCufqBO8OmGsUEilWHS9hNS d4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=VN4xU38c2Socn2ZYdTwvv5SFmuKG+B2ulpnFYXTNe84=; b=G6z/ooxilXcXP8r3yIMrsooWWJWgKEKDb2tiXwb1BgQ8kGKT3iwcqM+L78lbMFWw0P rvuo7sfSSZJMx8PpAUUm8DilJn/apbNMaBeW0mxQuuZyUHnJL44S5dzyPS4LUUnyVhJP i/TPopzl0NO3VKg7dS6hcFjtTelcJaVoFi/ouEkwGjnKwrmA4rsy9XDdOA9WfM9dRrk+ 3rRIcFGcXmfszRXmIyQjtPZO4f3wv9NYOJ5bApGrgoULZXEKb2tda9jBL9Mum4ghd20M jfjuUWtWJcluXjgF+FJd4i2FwHU9jVNkOp9qs0X8dUiV7HzcrZVi0ldZhe7dN+Arxqx/ yrdQ== X-Gm-Message-State: AOAM530/yTYLhSVNizY7rk6vkudECWmDdLj3YWkD+hZw2+GJlcujYVU5 iVrj2FmoaSm/ii+Jn+h/EEbTBe1oaaM= X-Google-Smtp-Source: ABdhPJx6Gh4SdLl/DqIIYBqNQ+lH2QPekVj7tRSchZzwSRIWMiO+SW9ul4Edna+Cb63bUJzLYRE4/A== X-Received: by 2002:a63:189:0:b0:3fa:ab5:4218 with SMTP id 131-20020a630189000000b003fa0ab54218mr36041051pgb.91.1653921982614; Mon, 30 May 2022 07:46:22 -0700 (PDT) Received: from sydneypc (14-202-149-165.tpgi.com.au. [14.202.149.165]) by smtp.gmail.com with ESMTPSA id t18-20020a1709028c9200b0016160b33319sm9195321plo.246.2022.05.30.07.46.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:46:22 -0700 (PDT) From: Chen Bin Date: Tue, 31 May 2022 00:45:49 +1000 Message-ID: <874k17cc4i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=chenbin.sh@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) Run below code in both Emacs 28.1 and Emacs 27.1 ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt ;; Then run below code in Emacs, (setq content (with-temp-buffer (let ((coding-system-for-read 'utf-8-unix)) (insert-file-contents "3g.txt")) (buffer-string))) (message "content length=%s" (length content)) (let* ((gc-cons-threshold most-positive-fixnum)) (message "%s vs %s" (benchmark-run-compiled 1 (string-match "aaaaa" content)) (benchmark-run-compiled 1 (string-match "bbbbb" content)))) Using same machine, same emacs setup, 28 is alwasy much slower than 27. Emacs 28 enables native compilation. But string-match is C API, so I'm not sure native compilation matters. In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu) of 2021-11-27, modified by Debian built on x86-csail-01 System Description: Debian GNU/Linux bookworm/sid Recent messages: Loading ivy...done Loading /home/cb/.custom.el (source)... *** Emacs loaded in 0.48 seconds with 0 garbage collections. Loading /home/cb/.custom.el (source)...done Loading /home/cb/.emacs.d/.session...done Loading /home/cb/.emacs.d/company-statistics-cache.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Color theme [doom-material-dark] loaded. [yas] Prepared just-in-time loading of snippets successfully. Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=no --without-gsettings 'CFLAGS=-g -O2 -ffile-prefix-map=/build/emacs-fQHadv/emacs-27.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: SOUND GPM DBUS NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 ZLIB XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LC_COLLATE: zh_CN.UTF-8 value of $LC_CTYPE: zh_CN.UTF-8 value of $LC_MESSAGES: en_US.UTF-8 value of $LC_MONETARY: zh_CN.UTF-8 value of $LC_NUMERIC: zh_CN.UTF-8 value of $LC_TIME: zh_CN.UTF-8 value of $LANG: value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: global-auto-revert-mode: t midnight-mode: t evil-find-char-pinyin-mode: t winner-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t global-git-gutter-mode: t display-time-mode: t which-key-mode: t global-evil-surround-mode: t evil-surround-mode: t global-evil-visualstar-mode: t evil-visualstar-mode: t global-evil-matchit-mode: t evil-matchit-mode: t diredfl-global-mode: t winum-mode: t company-statistics-mode: t global-company-mode: t company-mode: t ivy-mode: t evil-escape-mode: t shell-dirtrack-mode: t evil-mode: t evil-local-mode: t save-place-mode: t keyfreq-autosave-mode: t keyfreq-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/cb/.emacs.d/site-lisp/keyfreq/keyfreq hides /home/cb/.emacs.d/elpa/keyfreq-20210630.1318/keyfreq /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-mua hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-mua /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-maildir-fcc hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-maildir-fcc /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-tag hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-tag /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-tree hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-tree /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-version hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-version /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-print hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-print /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch /usr/share/emacs/site-lisp/elpa/notmuch-0.36/coolj hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/coolj /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-company hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-company /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-hello hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-hello /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-address hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-address /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-lib hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-lib /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-autoloads hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-autoloads /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-jump hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-jump /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-show hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-show /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-parser hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-parser /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-compat hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-compat /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-crypto hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-crypto /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-query hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-query /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-message hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-message /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-wash hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-wash /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-draft hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-draft /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-pkg hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-pkg Features: (shadow sort bbdb-message bbdb bbdb-site timezone wucuo wucuo-sdk find-lisp lazyflymake lazyflymake-sdk flymake-proc flymake mwheel warnings mail-extr auto-save autorevert filenotify midnight evil-exchange evil-find-char-pinyin pinyinlib winner display-line-numbers git-gutter time image which-key evil-surround evil-visualstar evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk sgml-mode dom evil-matchit-evil-setup yasnippet-snippets yasnippet emacsbug message rmc puny format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils doom-material-dark-theme doom-themes doom-themes-base cap-words superword subword amx s counsel xdg xref project dired-aux dired-x diredfl dired dired-loaddefs compile swiper winum dash term/xterm xterm company-ispell company-oddmuse company-keywords company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-semantic company-template company-bbdb company-cmake company-c-headers company-ctags find-file company-statistics company pcase session ivy delsel ivy-faces ivy-overlay colir color cus-start cus-load init-no-byte-compile init-evil general evil-escape evil evil-keybindings evil-integration evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-search evil-ex native-complete shell pcomplete comint regexp-opt ansi-color evil-types evil-macros evil-repeat evil-states evil-core advice evil-common windmove calc calc-loaddefs calc-macs thingatpt rect evil-digraphs evil-vars init-hydra cl-extra help-mode hydra ring lv init-writting init-dired init-shackle init-emacs-w3m init-misc saveplace init-essential init-theme init-httpd init-keyfreq keyfreq easy-mmode init-chinese init-company init-web-mode init-term-mode init-lua-mode init-gnus init-bbdb init-ctags init-clipboard init-gtags init-git init-linum-mode init-cc-mode init-yasnippet init-lisp init-python init-org init-javascript init-windows init-ivy init-ibuffer edmacro kmacro ibuf-macs init-spelling init-elpa init-file-type init-utils init-modeline init-autoload info tool-bar rx w3m-load package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib early-init china-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 367525 448971) (symbols 48 26562 13) (strings 32 77860 38359) (string-bytes 1 2651900) (vectors 16 30280) (vector-slots 8 399594 211814) (floats 8 499 826) (intervals 56 1790 90) (buffers 1000 12)) -- Best Regards, Chen Bin -- Help me, help you From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 15:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chen Bin Cc: 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165392283512355 (code B ref 55729); Mon, 30 May 2022 15:01:03 +0000 Received: (at 55729) by debbugs.gnu.org; 30 May 2022 15:00:35 +0000 Received: from localhost ([127.0.0.1]:45737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgsl-0003DB-8X for submit@debbugs.gnu.org; Mon, 30 May 2022 11:00:35 -0400 Received: from mail-qv1-f43.google.com ([209.85.219.43]:37477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgsk-0003Ct-7e for 55729@debbugs.gnu.org; Mon, 30 May 2022 11:00:34 -0400 Received: by mail-qv1-f43.google.com with SMTP id b11so10194487qvv.4 for <55729@debbugs.gnu.org>; Mon, 30 May 2022 08:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=HkQXHZ8Xo7bjda7oC9NPzWnYw2QOYk09of61x+RDPoo=; b=i84PK53bpAyb8rlrU0c+WU0avWUmzCGwGZSEqst9skyQM0WhrSnwl6BDbarKJOCEHO 7z2TuDuVtOie2oqMjPTiS3Uhpa4r5YYpH2VL4GI6W5oqROzgm9DDjheizkZNAD04uLJn QLYRExTIkhG2DlWpS3qLl+L+JAvjkcxOk5llQxYBIyOUc8jfwMqVpzV0d1oO1e7OTXe6 Gpk4iOvMh53QSGMJrjwhE/IT5GOjjSGoa0ElBAYCTgnbzxxhHakIgrpziyLYU26PMxH2 nT3MtqUcadB/vOgrzEyEm9Al5dfVpwn4nFS1AwxmKyAMx4P0mr1l9KbqaFSWF9c0cQFy yZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=HkQXHZ8Xo7bjda7oC9NPzWnYw2QOYk09of61x+RDPoo=; b=uRRbPauyahCneeuQyBm1DcthrG08E1M4O2hzMbo1yFr4eA15OpA76LbVWs8UXq79ZE Z0wIF5PsqMv/99wnL+kzIkGEFuzw8D5GR4Gu5auIJlXuLmmKFZvIM06SUKyitJ/5AHzM ZjW9kZbh9Qkfsp3NkOdYXh3nbIC/djPvvMYVHNea9nje3vLwDMG1fbPJ7HgUvozV4RP+ KOKDYFsgSEL4adADWtDaoN0o3yEbawYNXOuAsOHiUUi6VbrlEC8Bd7QXC//rwP8YKWww 2Q3vo8ZRCfAqfCscnp1RNKomMLNvQZs90WbvFirVptxKDmm7K2YioHOn7sujNbERET+k PE+Q== X-Gm-Message-State: AOAM5335srjzjcnumvw3s7g8dbYTunpF1//u1oW5NfkEOH/u7zKfTv0j 0h3Z5+0+hTcTrc7VmaHIg0Y= X-Google-Smtp-Source: ABdhPJxcE4TsKO8R2Fa2eyXAl+li6OwEl2a/VlIDi3jvOyySkTWrvnDUwq/3aLExxWiNBYzJXzxldQ== X-Received: by 2002:a05:6214:2523:b0:464:3296:4819 with SMTP id gg3-20020a056214252300b0046432964819mr12191786qvb.85.1653922828228; Mon, 30 May 2022 08:00:28 -0700 (PDT) Received: from localhost (22.b2.a86c.ip4.static.sl-reverse.com. [108.168.178.34]) by smtp.gmail.com with ESMTPSA id a25-20020ac87219000000b002f93be3ccfdsm7485282qtp.18.2022.05.30.08.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 08:00:27 -0700 (PDT) From: Ihor Radchenko In-Reply-To: <874k17cc4i.fsf@gmail.com> References: <874k17cc4i.fsf@gmail.com> Date: Mon, 30 May 2022 23:01:07 +0800 Message-ID: <87zgizysi4.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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 (/) Chen Bin writes: > Run below code in both Emacs 28.1 and Emacs 27.1 > > ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt > ;; Then run below code in Emacs, > > Using same machine, same emacs setup, 28 is alwasy much slower than 27. On my system: Emacs-27 (0.032783519 0 0.0) vs (0.093436952 0 0.0) Emacs-28 (latest) (0.037079772999999996 0 0.0) vs (0.162106006 0 0.0) Emacs-29 (latest) (0.03358834 0 0.0) vs (0.15387368299999998 0 0.0) Best, Ihor From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chen Bin Cc: 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165392342113741 (code B ref 55729); Mon, 30 May 2022 15:11:02 +0000 Received: (at 55729) by debbugs.gnu.org; 30 May 2022 15:10:21 +0000 Received: from localhost ([127.0.0.1]:45750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvh29-0003ZR-Ps for submit@debbugs.gnu.org; Mon, 30 May 2022 11:10:21 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvh25-0003Yp-EG for 55729@debbugs.gnu.org; Mon, 30 May 2022 11:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FKIH8FrxPAHuhYeOh/NwHrbyYfkiw/OrkheiiV2/Wdc=; b=fbkKnOtSavZvPQz3NFhgYGpGGK oCaCZ1K4S9yU+wNduztSpf4GZ9HzuAAa0+yVqgOlNHmF/2mz1aKfQWGKGDQ1lvDASK4VrfZlbyqNW jZX9VrW/eFXz8X6OH4sZTZyqj5t4sk/jAAT2ECsRmKLZbBNvHa/2TECt5hs4PJvTyNIs=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvh1v-0005tO-0C; Mon, 30 May 2022 17:10:06 +0200 From: Lars Ingebrigtsen References: <874k17cc4i.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUvMk61Vyv0oS7H mGG5vcT///8IG5BOAAAAAWJLR0QF+G/pxwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+YF Hg8JEcTBIWUAAAE4SURBVDjL1ZJtkoMgDIaT6gFI2gOU9AJVOABdcv8zbYBa0daZ7s8NM37k4X0T gwCvwHKhJWALkOU2k+fALYWABLYcsr8Otj/ML+AWcA4G7vOuBJIPgatiVE2qdktDAtQsN51vP7GC xnTIMCadNOjloaYeky3TaMhgypxgHHM2oE8Q7S3DOT9gjDpRBcUqqdVQvORMMWqmZ/ECBzNXxah6 yVqLAyQT3mEIGB8n0ek8xWnzHfaRHj2J8GZWrszQlycWkT34NF1X/Y7G7vAAEOAb2BbZAztC/wae J+LQwTYQDqKTb7sSvjYXK+H6vMWHnkgqaMittlzz7LkMt/xIvY94Qybybu2wCUq+etnGXtBIKYHL eZxkjdISL4B70PTNqQeu+X4AcgD4CEgH6O9A/gUgWgF/BXqrvd0vbl1dFGfxfEQAAABEdEVYdGNv bW1lbnQAQ1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0 IHF1YWxpdHkKAe4z2wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNS0zMFQxNTowOToxNyswMDow MDrkPvMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDUtMzBUMTU6MDk6MTcrMDA6MDBLuYZPAAAA AElFTkSuQmCC X-Now-Playing: Jean Michel Jarre's _Zoolook_: "Diva" Date: Mon, 30 May 2022 17:09:58 +0200 In-Reply-To: <874k17cc4i.fsf@gmail.com> (Chen Bin's message of "Tue, 31 May 2022 00:45:49 +1000") Message-ID: <87k0a3vyyh.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Chen Bin writes: > Using same machine, same emacs setup, 28 is alwasy much slower than 27. How much slower? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) 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 (---) Chen Bin writes: > Using same machine, same emacs setup, 28 is alwasy much slower than 27. How much slower? I tried your test, and the results were within a few percentages of each other in 27.1 and 28.1. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chen Bin Cc: 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165392345813824 (code B ref 55729); Mon, 30 May 2022 15:11:02 +0000 Received: (at 55729) by debbugs.gnu.org; 30 May 2022 15:10:58 +0000 Received: from localhost ([127.0.0.1]:45753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvh2n-0003as-HQ for submit@debbugs.gnu.org; Mon, 30 May 2022 11:10:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvh2j-0003aS-6Q for 55729@debbugs.gnu.org; Mon, 30 May 2022 11:10:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hLed6nxbWcx9GcHxaPP8QclDqpytRpmNesGbT+uQ+aY=; b=Rt99/g068d/dBKHdH/hgfTOAiZ eNTA8/fXeRygdMz8AkkJJMLkuZFpbSS0g0fR1dSe+5PgaG9OWJcilKw6rGGh7A0UHuXZVe4YzfR/B xr6GNEqhwhgZa0Vw5WA0e3FgrVhKtKVublE/a7VMAzuYwvEUeyOdhXziZ9u6eDRd/W6c=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvh2a-0005uB-ST; Mon, 30 May 2022 17:10:47 +0200 From: Lars Ingebrigtsen References: <874k17cc4i.fsf@gmail.com> <87k0a3vyyh.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUvMk61Vyv0oS7H mGG5vcT///8IG5BOAAAAAWJLR0QF+G/pxwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+YF Hg8JEcTBIWUAAAE4SURBVDjL1ZJtkoMgDIaT6gFI2gOU9AJVOABdcv8zbYBa0daZ7s8NM37k4X0T gwCvwHKhJWALkOU2k+fALYWABLYcsr8Otj/ML+AWcA4G7vOuBJIPgatiVE2qdktDAtQsN51vP7GC xnTIMCadNOjloaYeky3TaMhgypxgHHM2oE8Q7S3DOT9gjDpRBcUqqdVQvORMMWqmZ/ECBzNXxah6 yVqLAyQT3mEIGB8n0ek8xWnzHfaRHj2J8GZWrszQlycWkT34NF1X/Y7G7vAAEOAb2BbZAztC/wae J+LQwTYQDqKTb7sSvjYXK+H6vMWHnkgqaMittlzz7LkMt/xIvY94Qybybu2wCUq+etnGXtBIKYHL eZxkjdISL4B70PTNqQeu+X4AcgD4CEgH6O9A/gUgWgF/BXqrvd0vbl1dFGfxfEQAAABEdEVYdGNv bW1lbnQAQ1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0 IHF1YWxpdHkKAe4z2wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNS0zMFQxNTowOToxNyswMDow MDrkPvMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDUtMzBUMTU6MDk6MTcrMDA6MDBLuYZPAAAA AElFTkSuQmCC X-Now-Playing: Jean Michel Jarre's _Zoolook_: "Diva" Date: Mon, 30 May 2022 17:10:44 +0200 In-Reply-To: <87k0a3vyyh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 30 May 2022 17:09:58 +0200") Message-ID: <87fskrvyx7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > How much slower? D'oh -- you said so in the subject. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) 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 (---) Lars Ingebrigtsen writes: > How much slower? D'oh -- you said so in the subject. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 15:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: chenbin.sh@gmail.com, 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165392630420819 (code B ref 55729); Mon, 30 May 2022 15:59:01 +0000 Received: (at 55729) by debbugs.gnu.org; 30 May 2022 15:58:24 +0000 Received: from localhost ([127.0.0.1]:45830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvhmi-0005Pi-AA for submit@debbugs.gnu.org; Mon, 30 May 2022 11:58:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvhme-0005PM-4O for 55729@debbugs.gnu.org; Mon, 30 May 2022 11:58:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhmY-0005it-Lr; Mon, 30 May 2022 11:58:14 -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=R8t+nviVfclUQwb6gPLz0qqdTIICBiDD4JvSBjQEtM4=; b=Zjm0XW2FeZdO fBrBp3DF26fkJPkyoNqJTM7AtSR8W08gNGTvqWj84qAWgFHxxMgbjINOrYgC5oCYOq41g5KTatoWC E27/XfdE/2amT9E0r6gvRpWq+QmKMh/R4oWD+GFLH7dAQwiuCZp73J0ToXm46LXewRz86hkfYS/pr SJBSrkZoe9nS12mKC+SL9v/cGnAgEPSMsGDOtNP6Icf3JoJV1fR6ewFLbR7nO98x6CFpR7ExMhsXM utpzn0qnUNQ2cE4MbgToAAcLQiUdVAzXGBB/tf+1azxrFnDQaMWYKIaV0LzGBxOfzQdos2GQxhteG 393nwrrKFciqiiJZUPwxog==; Received: from [87.69.77.57] (port=1943 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 1nvhmY-0001iL-3b; Mon, 30 May 2022 11:58:14 -0400 Date: Mon, 30 May 2022 18:58:17 +0300 Message-Id: <83bkvfj9ly.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87k0a3vyyh.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 30 May 2022 17:09:58 +0200) References: <874k17cc4i.fsf@gmail.com> <87k0a3vyyh.fsf@gnus.org> X-Spam-Score: -2.3 (--) 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 (---) > Resent-From: Lars Ingebrigtsen > Original-Sender: "Debbugs-submit" > Resent-CC: bug-gnu-emacs@gnu.org > Resent-Sender: help-debbugs@gnu.org > Cc: 55729@debbugs.gnu.org > From: Lars Ingebrigtsen > Date: Mon, 30 May 2022 17:09:58 +0200 > > Chen Bin writes: > > > Using same machine, same emacs setup, 28 is alwasy much slower than 27. > > How much slower? > > I tried your test, and the results were within a few percentages of each > other in 27.1 and 28.1. With a 3GB file being inserted non-literally, there could be factors at work here that are entirely unrelated to processing speed. The implementation of string-match basically didn't change between Emacs 27 and Emacs 28, AFAICT. From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2022 16:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: larsi@gnus.org, chenbin.sh@gmail.com Cc: 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165392661421749 (code B ref 55729); Mon, 30 May 2022 16:04:01 +0000 Received: (at 55729) by debbugs.gnu.org; 30 May 2022 16:03:34 +0000 Received: from localhost ([127.0.0.1]:45851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvhrh-0005ei-Tb for submit@debbugs.gnu.org; Mon, 30 May 2022 12:03:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvhre-0005eG-Qh for 55729@debbugs.gnu.org; Mon, 30 May 2022 12:03:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhrZ-0006XL-Fu; Mon, 30 May 2022 12:03:25 -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=BUElB+oe4sI5GlnX+WzYqkN/D8McJ6RH9h4YGsHjcdM=; b=AJH94N5XmWzQ piIWdENcmMaZzeqOurXdGtMlM9ObaY8V5d7cb7bMRRxYcpbkBP9HXnmxXcD9q0tJFjgMeh/eNHkCs xOTdWHMCnocSw3m0xyDF4yE6II14Y4QN8ODP+61QhsjaS0ro0NbmpDUz+/vxbhoxPn23AytHdXLT7 7ENpJIdgGecFCcP3i4Rs1XiAIy28nWWXVmqzgz2g0FFMMwMyB3nB2rewYR2O66lTa7XoEOyPyXD0Q xbdXnAokNEofBoP825a9lwMBXuOR+b1lko/27WvoCkHVy3cS6mGEn+TW/KKskaSpgV8kyTkQiaX+k vyAxXv3ofSHrusvCUZrdtw==; Received: from [87.69.77.57] (port=2263 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 1nvhrY-00085k-S5; Mon, 30 May 2022 12:03:25 -0400 Date: Mon, 30 May 2022 19:03:28 +0300 Message-Id: <838rqjj9db.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <83bkvfj9ly.fsf@gnu.org> (message from Eli Zaretskii on Mon, 30 May 2022 18:58:17 +0300) References: <874k17cc4i.fsf@gmail.com> <87k0a3vyyh.fsf@gnus.org> <83bkvfj9ly.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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 (---) > Cc: chenbin.sh@gmail.com, 55729@debbugs.gnu.org > Date: Mon, 30 May 2022 18:58:17 +0300 > From: Eli Zaretskii > > > I tried your test, and the results were within a few percentages of each > > other in 27.1 and 28.1. > > With a 3GB file being inserted non-literally, there could be factors > at work here that are entirely unrelated to processing speed. The > implementation of string-match basically didn't change between Emacs > 27 and Emacs 28, AFAICT. Here's one random thought: were both Emacs 27 and Emacs 28 compiled with the same compiler version, and do they both use the same version of the Standard C Library? From unknown Fri Aug 15 15:57:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2022 01:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chen Bin Cc: 55729@debbugs.gnu.org Received: via spool by 55729-submit@debbugs.gnu.org id=B55729.165395906918000 (code B ref 55729); Tue, 31 May 2022 01:05:01 +0000 Received: (at 55729) by debbugs.gnu.org; 31 May 2022 01:04:29 +0000 Received: from localhost ([127.0.0.1]:46283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvqJB-0004gG-E3 for submit@debbugs.gnu.org; Mon, 30 May 2022 21:04:29 -0400 Received: from sonic308-10.consmr.mail.ne1.yahoo.com ([66.163.187.33]:37536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvqJ9-0004fv-P6 for 55729@debbugs.gnu.org; Mon, 30 May 2022 21:04:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1653959060; bh=VH+LkZcuxbUEEYejlQBW6ZqO9D5PsyFLgHKY574voSs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=gRLone/O3OwsqjTyFHen3vDx57AcgvPNoMZTyUN3a7F5Dt5VPCUoUjEoPM1ZXqaPHMWBJ1T5G5VntoHmzx4wNu9uTLn+AcLf9R2XILugp+7/H/S7CRByy7SlXfAVTvp7LQ6i0oEMFpY6ibmgdHoth1fVBoOFeYztjGmeP9FysG9hRMJqU5A4bsRKy6VA5YCFZKr4WtOnZjJ+khLw5yLSlOn70CQLxpo9UOvIAjvdsVEGp61r5xeb+2GecrLe/RjFqIdqKBalKW+ceOuP4PUqpWyWT8qgbepRXIj/VJSuQJTx/R1QcuUI2XzE3w5Flh5QdxrBdCuqijzk2ZpVr/lymw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1653959060; bh=HqGpEEYDawkH94JqP6lXvbh1yWVhDwbLbPquXbAADEU=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=If+TfXpztqgsZcHcsEstoKZRaWxc8mT2y+iWqR2mtIO9bpjvBRPMjX0oLz6SANM4mnBXSpoC+if/gRBdV/OPQN5SMPqLW0iCzD+9AM08UdhWNaae3wnKaF1QZNZwhR7HBBr0dtjUHaVLDCtAA/xoDLxKocIGD90fcftQXKlHlvOWidLPVtInpjuuiiJs1UNxZEP7ulNC7f0yZbD5pTaydq1lmcc1OlcXiR4uwqfK+R8UslndEBwjQwjZF3C4hgIZfKU6t+rx9rA1eL1WQoDsQ0ueMsNH08g06zz7MoTQlgAWaiq78T8kntEfsRSDmFvdkjQVT9t/Mho2Rx9i7tZRPA== X-YMail-OSG: qKG.ByIVM1m9iSc4XktAZBObCtmvMDojHvWDSLXYXlYY4NvJscdfWL2HM4A_tnm yOKRl7fVDOW1f2J9W.zmlr09nmoXD7MBayQlvPc5ycgweJeJQQtymB2kCvUlioHmyZDrHxqtsFoT ZdE.z38QIJhikMS3iQdogJ6tcktMK2Vt5Ps43cYCKYEK_4Za3d.ap5iDfc853cW23OGfasnHcYSg SK6ObA9y01Em0xs91zOXSvcVcMnFYbWsD4XDq0PrqzXMglkBHpDoglcvVYMVnUddSLwZP6iwcF9K HW84pGAnzqbPW3KhBS71KOcEjr6Ejz662KhSsYst2pWHOl.2LrP74cf8Uk.yMA8Wp.vZ3ucqUi3O Z4jQdY3GVPsQVS8OXATUh0cDydDWY1WJYkeAUl5G8V3nrAmGgDVhJrXSjc3YOCJlfrc5Tn8Nuwkj PpFjaNaUetCAaH6WSsIRdNW.A0ykYtSShLhwutsUr6LJ_dMthKekT0j.qMSnXYv554DBDgCZhUJo D0h4w5UBkLGeZmc.wJ1UNHEQ5iUx7z8WcDI7997iVmd9YsWbmG9pEVhnibmaCQB1D8l56sou1l8e zIUMVJvQqclKh7VbrWIuv7mDL9ZAzm2WrNMDSKbcKVZZYLlxPrG0LkiVq_Ig_e0QIPvZ_2LXQv6P o9OH8_VQcmOpRDHOujNstHw0H5IJgIMUZiHNfm7RZPBRGAvU4EqXE9zVakuQEH74prhARcELiU_r ObCPZ0NwUJHpU5oyEKStc7UX2qD3E3H4ErDhuydNhWLjGweojCuZ9PwxBRZwRLHsV_.CxYEFJq6Y aqF1p5FoxWkeMY.qRy1C3clIyfpV9ckyossBunBntwF2YcRxanKA7MFcOYa6zzqmYvlA5Zv35xuH PLyvpu6PeAet.XDVU2Y0PzGHvH0_uaarl8WJiBHGvv4d8ztyGLN82Uoy2twjUlyu3jRvZj7toHn2 MWBKrNx7nEet2z3nHZcExPaNd1cl5BFonCl8ezITcgJSxA.EpES1ZP6wQu4jJ.O8hpO2nfzJGgy9 3PSTWbi_4IXfuaxyMjYIGMjM8bQi5A1hbou2u3a9F7Fiwu_t9BXSSUHt56DKY2fXjApdW_LzIO.N 71TrU4vGYo4Tl0wprvrVPL4A5VxEwQEfnWXG67i5EhyyUYi7UoGPxqL86U34e5wDCs4UkW0zf4PM kOJjvSAAXmyiEv266SQ8H_9LbD2BA2WyMQMUZsKRgTmxCZJRfa04p5Wk0OdvcdG_Br2gQBf.SG3C rGzHYrMB1jdcrFTFqmYkj_uf2WtLzUj_mWGN2MnoHdRFq6rIg46cAM9RDyEYPwbqMVXUf_gaBxTg hpVrgn.agbowdpUTcbWkHZT3_zQP9VEwb86mvjoyPIvnz2vmwHBbPGMic5QAOuDu2wXkcJDua3BB k2sI9PKwzeeSfBZz4P.BLnlNhkGRBsMQfEMySQ.z64alMvXKIaiNXKIjI6UgTJirNrR0TXeSLPNI EgobGwdYdPasUcx6V9FXqL72rDBR6ZwX9oZTeTU9dER6LA0EbHCPEVOVhiCj97lsqAFB0y2yg6TB CY3fDB0dcTSEb8gZW6YNLC7waaPoB5P7DGDoucxUqjIQQvwPiYWeXmRnGN2tXpVFYsHge3hhwibc G0FzaGkVDczJtPKiznAlnAXG16yRM59z9xKyxZnJUBypnjwpxV3oK5x5vE8fqMMOlGRnJLsbCYPT CwpBU0pTorDJeO_aAjSavLdm2yGbqa6df49n6txl5BazV69epNJtVLzLGHNZ5cNu2Nh3aUs1rhhi SgXMKUNumjIbNDDsOgh4M_VT493nRxcUcCTftxE79Hnx1Qg_bCr9cZTqq.tFFG02aR...xQfjrSQ 7amqZUksnrNtMD8DDeljT9vkDNSx2B.TCuapHqHWSLQidQAoYe2JI6V5zM77ZIvUmEO68qDWDERu Xov2E5Itsh5dOyYcuf_r5hd1x_a.n1_MkmRUzlRxKCe3HflYWS2IZqC1nn86fsw0SFhMJKGVhMXO asA8QfGv3yEQjp8qVkc.Rxjx29wNrEMiFrhD_0OWPeuZd4saaJ5u0svBO2zDAa2papIC5ImEzckF YlYMm56NWC2IohEFIdzPCg3hQRojF5vWshuDHFFCIlXPaMsRXmTZgk0ufkgo2tempfHtf9QxDkHu UgKziVHgl7LQCv.J.VwZYqHsIt9RQS1q6dvjBSNAYWDmQz34Uxz2ikAMVHKTngk2eVxrLs9tlE_6 dEaUpg457NXdmQt_N6_Gqc17Mq37MmltHLxK8Q.ESZOLFkCWW1yZLTiFXx.hH9Q-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 31 May 2022 01:04:20 +0000 Received: by hermes--canary-production-sg3-5f7658c994-qwjwx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 05802a6eef7d8575d931887b99509881; Tue, 31 May 2022 01:04:17 +0000 (UTC) From: Po Lu References: <874k17cc4i.fsf@gmail.com> Date: Tue, 31 May 2022 09:04:13 +0800 In-Reply-To: <874k17cc4i.fsf@gmail.com> (Chen Bin's message of "Tue, 31 May 2022 00:45:49 +1000") Message-ID: <87sfoqa4xe.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.20225 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 927 X-Spam-Score: -0.0 (/) 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: -1.0 (-) Chen Bin writes: > Run below code in both Emacs 28.1 and Emacs 27.1 > > ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt > ;; Then run below code in Emacs, > (setq content > (with-temp-buffer > (let ((coding-system-for-read 'utf-8-unix)) > (insert-file-contents "3g.txt")) > (buffer-string))) > > (message "content length=%s" (length content)) > (let* ((gc-cons-threshold most-positive-fixnum)) > (message "%s vs %s" > (benchmark-run-compiled 1 > (string-match "aaaaa" content)) > (benchmark-run-compiled 1 > (string-match "bbbbb" content)))) > > Using same machine, same emacs setup, 28 is alwasy much slower than 27. > > Emacs 28 enables native compilation. But string-match is C API, so I'm not > sure native compilation matters. Did you disable compiler optimizations when building Emacs? From unknown Fri Aug 15 15:57:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Chen Bin Subject: bug#55729: closed (Re: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1) Message-ID: References: <834k16jv4c.fsf@gnu.org> <874k17cc4i.fsf@gmail.com> X-Gnu-PR-Message: they-closed 55729 X-Gnu-PR-Package: emacs Reply-To: 55729@debbugs.gnu.org Date: Tue, 31 May 2022 02:26:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1653963962-28899-1" This is a multi-part message in MIME format... ------------=_1653963962-28899-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 55729@debbugs.gnu.org. --=20 55729: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55729 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1653963962-28899-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 55729-done) by debbugs.gnu.org; 31 May 2022 02:25:59 +0000 Received: from localhost ([127.0.0.1]:46327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvra3-0007Vo-Kb for submit@debbugs.gnu.org; Mon, 30 May 2022 22:25:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvra1-0007VT-UX for 55729-done@debbugs.gnu.org; Mon, 30 May 2022 22:25:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvrZw-00056z-M8; Mon, 30 May 2022 22:25:52 -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=5hN0+qhcd+3LIFLC5t+43gtf/TBeJy2pwdMLNKRpOO8=; b=JEZctm3bEo0/ bRkiBSFhPjADMG2LwQJHTSMsSViCVqBegOSoF2usVuzvAsdp8yP0i1UXCM7dAMyccmfOSv5LJPltx hfAQPBnVQUzVhINN6ShSSn9wSUQuP8HryxYpfg5Vi9FKo79fu9rbfKyDWsRdlM9exPSGZatkFyUCy fdoCtMdwwQgk233fFhmBjyx3f2D/gAIu02n2TWN3OjxdGe1Mh/0iMJyj26lgBxGcsTmjtp+L+oaU5 Nwji30DAHVL2Iz7csdhb4RAhNHIbltee75UGTZmVluq5jf1ioT0agXdpPBmCTK8o1tBTCatorKskh wZAPpPQYvBdXWoS86Mko/A==; Received: from [87.69.77.57] (port=4601 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 1nvrZw-0006CW-5e; Mon, 30 May 2022 22:25:52 -0400 Date: Tue, 31 May 2022 05:25:55 +0300 Message-Id: <834k16jv4c.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87sfoqa4xe.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) Subject: Re: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 References: <874k17cc4i.fsf@gmail.com> <87sfoqa4xe.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55729-done Cc: chenbin.sh@gmail.com, 55729-done@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 (---) > Cc: 55729@debbugs.gnu.org > Date: Tue, 31 May 2022 09:04:13 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Chen Bin writes: > > > Run below code in both Emacs 28.1 and Emacs 27.1 > > > > ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt > > ;; Then run below code in Emacs, > > (setq content > > (with-temp-buffer > > (let ((coding-system-for-read 'utf-8-unix)) > > (insert-file-contents "3g.txt")) > > (buffer-string))) > > > > (message "content length=%s" (length content)) > > (let* ((gc-cons-threshold most-positive-fixnum)) > > (message "%s vs %s" > > (benchmark-run-compiled 1 > > (string-match "aaaaa" content)) > > (benchmark-run-compiled 1 > > (string-match "bbbbb" content)))) > > > > Using same machine, same emacs setup, 28 is alwasy much slower than 27. > > > > Emacs 28 enables native compilation. But string-match is C API, so I'm not > > sure native compilation matters. > > Did you disable compiler optimizations when building Emacs? Yes. Here's the response (sent only to myself): > From: Chen Bin > Date: Tue, 31 May 2022 04:53:55 +1000 > > Thanks for the heads up. > > I double checked my build script and found I forgot to setup `-O2' > CFLAG. Sorry to bother you guys with such my mistake. > > It's all good now. So I'm closing this bug. ------------=_1653963962-28899-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 May 2022 14:46:38 +0000 Received: from localhost ([127.0.0.1]:45720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgfF-0002f0-UJ for submit@debbugs.gnu.org; Mon, 30 May 2022 10:46:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:37516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvgfE-0002et-MM for submit@debbugs.gnu.org; Mon, 30 May 2022 10:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvgfC-0001sn-Bw for bug-gnu-emacs@gnu.org; Mon, 30 May 2022 10:46:36 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:36503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvgf8-00036n-2a for bug-gnu-emacs@gnu.org; Mon, 30 May 2022 10:46:31 -0400 Received: by mail-pg1-x529.google.com with SMTP id j191so3093777pgd.3 for ; Mon, 30 May 2022 07:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=VN4xU38c2Socn2ZYdTwvv5SFmuKG+B2ulpnFYXTNe84=; b=lWwraJNX5lmtM0hTgyheIkxOoyuzCAt16hoUPGl+q8qOBuEkJL8oHsC75HG2AM3x1U jbNFFdCg6RtrsmQlycwQBbA7qrkDYuS+6xJ4FzUhFYjz2fqNk998b6NfQYnNOcmuzA/f WckyCFVU+beEdM8Mba0ZvVi5QqVs1WcIAc57h2sc/L5Fez0qNllaeBfRnZ14yirNBeY0 IaxbJuMmbFxR+8kSZXXECWxqRLsyttJXXribN4I6W8lnXGFBLLh+PA9sOEjd7uIUTqS/ Vq3gKjSEzYewIXV68TTkHexg1N1EkHSO1W0jnavIYjOgLRCufqBO8OmGsUEilWHS9hNS d4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=VN4xU38c2Socn2ZYdTwvv5SFmuKG+B2ulpnFYXTNe84=; b=G6z/ooxilXcXP8r3yIMrsooWWJWgKEKDb2tiXwb1BgQ8kGKT3iwcqM+L78lbMFWw0P rvuo7sfSSZJMx8PpAUUm8DilJn/apbNMaBeW0mxQuuZyUHnJL44S5dzyPS4LUUnyVhJP i/TPopzl0NO3VKg7dS6hcFjtTelcJaVoFi/ouEkwGjnKwrmA4rsy9XDdOA9WfM9dRrk+ 3rRIcFGcXmfszRXmIyQjtPZO4f3wv9NYOJ5bApGrgoULZXEKb2tda9jBL9Mum4ghd20M jfjuUWtWJcluXjgF+FJd4i2FwHU9jVNkOp9qs0X8dUiV7HzcrZVi0ldZhe7dN+Arxqx/ yrdQ== X-Gm-Message-State: AOAM530/yTYLhSVNizY7rk6vkudECWmDdLj3YWkD+hZw2+GJlcujYVU5 iVrj2FmoaSm/ii+Jn+h/EEbTBe1oaaM= X-Google-Smtp-Source: ABdhPJx6Gh4SdLl/DqIIYBqNQ+lH2QPekVj7tRSchZzwSRIWMiO+SW9ul4Edna+Cb63bUJzLYRE4/A== X-Received: by 2002:a63:189:0:b0:3fa:ab5:4218 with SMTP id 131-20020a630189000000b003fa0ab54218mr36041051pgb.91.1653921982614; Mon, 30 May 2022 07:46:22 -0700 (PDT) Received: from sydneypc (14-202-149-165.tpgi.com.au. [14.202.149.165]) by smtp.gmail.com with ESMTPSA id t18-20020a1709028c9200b0016160b33319sm9195321plo.246.2022.05.30.07.46.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:46:22 -0700 (PDT) From: Chen Bin To: bug-gnu-emacs@gnu.org Subject: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1 Date: Tue, 31 May 2022 00:45:49 +1000 Message-ID: <874k17cc4i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=chenbin.sh@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) Run below code in both Emacs 28.1 and Emacs 27.1 ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt ;; Then run below code in Emacs, (setq content (with-temp-buffer (let ((coding-system-for-read 'utf-8-unix)) (insert-file-contents "3g.txt")) (buffer-string))) (message "content length=%s" (length content)) (let* ((gc-cons-threshold most-positive-fixnum)) (message "%s vs %s" (benchmark-run-compiled 1 (string-match "aaaaa" content)) (benchmark-run-compiled 1 (string-match "bbbbb" content)))) Using same machine, same emacs setup, 28 is alwasy much slower than 27. Emacs 28 enables native compilation. But string-match is C API, so I'm not sure native compilation matters. In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu) of 2021-11-27, modified by Debian built on x86-csail-01 System Description: Debian GNU/Linux bookworm/sid Recent messages: Loading ivy...done Loading /home/cb/.custom.el (source)... *** Emacs loaded in 0.48 seconds with 0 garbage collections. Loading /home/cb/.custom.el (source)...done Loading /home/cb/.emacs.d/.session...done Loading /home/cb/.emacs.d/company-statistics-cache.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Color theme [doom-material-dark] loaded. [yas] Prepared just-in-time loading of snippets successfully. Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=no --without-gsettings 'CFLAGS=-g -O2 -ffile-prefix-map=/build/emacs-fQHadv/emacs-27.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: SOUND GPM DBUS NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 ZLIB XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LC_COLLATE: zh_CN.UTF-8 value of $LC_CTYPE: zh_CN.UTF-8 value of $LC_MESSAGES: en_US.UTF-8 value of $LC_MONETARY: zh_CN.UTF-8 value of $LC_NUMERIC: zh_CN.UTF-8 value of $LC_TIME: zh_CN.UTF-8 value of $LANG: value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: global-auto-revert-mode: t midnight-mode: t evil-find-char-pinyin-mode: t winner-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t global-git-gutter-mode: t display-time-mode: t which-key-mode: t global-evil-surround-mode: t evil-surround-mode: t global-evil-visualstar-mode: t evil-visualstar-mode: t global-evil-matchit-mode: t evil-matchit-mode: t diredfl-global-mode: t winum-mode: t company-statistics-mode: t global-company-mode: t company-mode: t ivy-mode: t evil-escape-mode: t shell-dirtrack-mode: t evil-mode: t evil-local-mode: t save-place-mode: t keyfreq-autosave-mode: t keyfreq-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/cb/.emacs.d/site-lisp/keyfreq/keyfreq hides /home/cb/.emacs.d/elpa/keyfreq-20210630.1318/keyfreq /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-mua hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-mua /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-maildir-fcc hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-maildir-fcc /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-tag hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-tag /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-tree hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-tree /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-version hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-version /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-print hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-print /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch /usr/share/emacs/site-lisp/elpa/notmuch-0.36/coolj hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/coolj /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-company hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-company /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-hello hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-hello /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-address hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-address /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-lib hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-lib /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-autoloads hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-autoloads /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-jump hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-jump /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-show hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-show /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-parser hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-parser /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-compat hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-compat /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-crypto hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-crypto /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-query hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-query /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-message hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-message /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-wash hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-wash /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-draft hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-draft /usr/share/emacs/site-lisp/elpa/notmuch-0.36/notmuch-pkg hides /usr/share/emacs/site-lisp/elpa-src/notmuch-0.36/notmuch-pkg Features: (shadow sort bbdb-message bbdb bbdb-site timezone wucuo wucuo-sdk find-lisp lazyflymake lazyflymake-sdk flymake-proc flymake mwheel warnings mail-extr auto-save autorevert filenotify midnight evil-exchange evil-find-char-pinyin pinyinlib winner display-line-numbers git-gutter time image which-key evil-surround evil-visualstar evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk sgml-mode dom evil-matchit-evil-setup yasnippet-snippets yasnippet emacsbug message rmc puny format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils doom-material-dark-theme doom-themes doom-themes-base cap-words superword subword amx s counsel xdg xref project dired-aux dired-x diredfl dired dired-loaddefs compile swiper winum dash term/xterm xterm company-ispell company-oddmuse company-keywords company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-semantic company-template company-bbdb company-cmake company-c-headers company-ctags find-file company-statistics company pcase session ivy delsel ivy-faces ivy-overlay colir color cus-start cus-load init-no-byte-compile init-evil general evil-escape evil evil-keybindings evil-integration evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-search evil-ex native-complete shell pcomplete comint regexp-opt ansi-color evil-types evil-macros evil-repeat evil-states evil-core advice evil-common windmove calc calc-loaddefs calc-macs thingatpt rect evil-digraphs evil-vars init-hydra cl-extra help-mode hydra ring lv init-writting init-dired init-shackle init-emacs-w3m init-misc saveplace init-essential init-theme init-httpd init-keyfreq keyfreq easy-mmode init-chinese init-company init-web-mode init-term-mode init-lua-mode init-gnus init-bbdb init-ctags init-clipboard init-gtags init-git init-linum-mode init-cc-mode init-yasnippet init-lisp init-python init-org init-javascript init-windows init-ivy init-ibuffer edmacro kmacro ibuf-macs init-spelling init-elpa init-file-type init-utils init-modeline init-autoload info tool-bar rx w3m-load package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib early-init china-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 367525 448971) (symbols 48 26562 13) (strings 32 77860 38359) (string-bytes 1 2651900) (vectors 16 30280) (vector-slots 8 399594 211814) (floats 8 499 826) (intervals 56 1790 90) (buffers 1000 12)) -- Best Regards, Chen Bin -- Help me, help you ------------=_1653963962-28899-1--