From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.bugs Subject: bug#44610: 27.1; Keyboard Macro Performance Problem Date: Fri, 13 Nov 2020 02:51:12 +0000 Message-ID: <87d00irmu7.fsf@robertthorpeconsulting.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10036"; mail-complaints-to="usenet@ciao.gmane.io" To: 44610@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 13 03:52:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdPC5-0002Wx-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 03:52:10 +0100 Original-Received: from localhost ([::1]:51604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdPC4-00008Y-El for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 21:52:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdPBy-00008P-W8 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 21:52:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdPBy-0006GN-Mr for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 21:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdPBy-0001Xz-JT for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 21:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Thorpe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Nov 2020 02:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44610 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16052359075919 (code B ref -1); Fri, 13 Nov 2020 02:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2020 02:51:47 +0000 Original-Received: from localhost ([127.0.0.1]:46205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdPBi-0001XP-St for submit@debbugs.gnu.org; Thu, 12 Nov 2020 21:51:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdPBe-0001XF-VA for submit@debbugs.gnu.org; Thu, 12 Nov 2020 21:51:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdPBe-00006X-Mq for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 21:51:42 -0500 Original-Received: from outbound-smtp35.blacknight.com ([46.22.139.218]:60685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdPBb-0006EQ-4x for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 21:51:42 -0500 Original-Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp35.blacknight.com (Postfix) with ESMTPS id C7F40242A for ; Fri, 13 Nov 2020 02:51:34 +0000 (GMT) Original-Received: (qmail 4724 invoked from network); 13 Nov 2020 02:51:34 -0000 Original-Received: from unknown (HELO rt-inspiron-3480) (rt@robertthorpeconsulting.com@[51.37.30.105]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 13 Nov 2020 02:51:34 -0000 Received-SPF: pass client-ip=46.22.139.218; envelope-from=rt@robertthorpeconsulting.com; helo=outbound-smtp35.blacknight.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 21:51:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193200 Archived-At: This bug report comes from a discussion on Emacs reddit. Start with a blank buffer and create about ~300 lines of the string: ffffffffffffffffffff (pppppppppppppppppppp); This will be turned into: 'ffffffffffffffffffff': That can be done using the following keyboard macro: M-m ' M-f ' : C-k C-n You can apply that to every line in the buffer using C-u 300 f4. Now here's the strange bit. In a fundamental-mode buffer this is extremely fast, nearly instantaneous. But, in a python-mode buffer it takes 20 to 30 seconds. If the mode is c-mode then it is also much slower than fundamental-mode. It will also exceed the variable binding depth in some cases. Oddly it is faster if you use forward-line instead of C-n. Here is the original thread: https://www.reddit.com/r/emacs/comments/joeno5/anyway_to_speed_up_macros_in= _emacs/ I understand it might not be worth fixing if it's a corner case. BR, Robert Thorpe In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cair= o version 1.17.3) of 2020-08-28 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Arch Linux Recent messages: Keyboard macro defined Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help. Mark set [2 times] Saved text until "fffffffffffff (pppppppppppppppppppp); " Mark set [2 times] Defining kbd macro... You can run the command =E2=80=98forward-line=E2=80=99 with M-x fo-lin RET Keyboard macro defined Can=E2=80=99t guess python-indent-offset, using defaults: 4 Configured using: 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: shell-dirtrack-mode: t dynamic-completion-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-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 column-number-mode: t line-number-mode: t global-visual-line-mode: t visual-line-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow mail-extr emacsbug sendmail eieio-opt cl-extra speedbar sb-image ezimage dframe find-func thingatpt help-fns radix-tree help-mode python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 ls-lisp comint ring ansi-color cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dired-aux autorevert filenotify calc-alg calc-ext calc-menu calc calc-loaddefs calc-macs view sort disp-table tetris gamegrid rmailsum misearch multi-isearch noutline outline easy-mmode shr-color color shr url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs json map url-vars svg xml dom browse-url qp rmailout rmailmm message rmc puny dired-x dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils bookmark easymenu text-property-search pp server completion avoid misc edmacro kmacro cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar 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 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 212016 51202) (symbols 48 17470 1) (strings 32 53646 2929) (string-bytes 1 1713027) (vectors 16 29359) (vector-slots 8 1024997 53850) (floats 8 262 286) (intervals 56 13457 0) (buffers 1000 44))