Eli Zaretskii writes: >> Date: Mon, 28 Nov 2022 02:00:29 +0600 >> From: Akib Azmain Turja via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Term mode is very slow. On my computer, Coterm is 2-3x faster than >> term, and my own terminal emulator, Eat, is 4-5x faster. >> >> I tried to profile Term. Steps: >> >> 1. emacs -Q (+ -nw, environment variable DISPLAY was unset) >> 2. M-x profiler-start RET cpu+mem RET >> 3. M-x term >> 4. Run the following stupid command: >> timeout 1 bash -c 'i=0 ; while true ; do echo $i ; i=$((i+1)) ; done' >> Note I also run emacs -nw in before this command. >> 5. Wait for finishing. >> 6. M-x profiler-stop >> 7. M-x profiler-report >> >> Here are the reports (attached), but don't seem to be human readable: > > Copy them from the display shown by profiler-report, after you expand it > completely. > > And the "cpu" profile is enough; the "mem" one doesn't add anything useful. Sorry, I missed this reply. I found this in debbugs.gnu.org. :O Here is the data: (I didn't redo the steps, I just did 'M-x profiler-find-profile RET path/to/profile'. ;) ) --8<---------------cut here---------------start------------->8--- 9397 95% - term-emulate-terminal 2710 27% - term-handle-ansi-escape 1831 18% - term-down 8 0% term-move-columns 765 7% - term-goto 714 7% term-down 82 0% - term--handle-colors-list 66 0% - term--color-as-hex 34 0% - face-background 34 0% - face-attribute 20 0% - face-attribute-merged-with 16 0% face-attribute 6 0% face-attribute 32 0% - face-foreground 20 0% - face-attribute 8 0% face-attribute 1846 18% - term-down 68 0% - vertical-motion 68 0% - jit-lock-function 68 0% - jit-lock-fontify-now 28 0% - jit-lock--run-functions 8 0% - # 8 0% - font-lock-fontify-region 8 0% - font-lock-default-fontify-region 8 0% font-lock-unfontify-region 8 0% - # 8 0% - font-lock-fontify-region 8 0% font-lock-default-fontify-region 4 0% - # 4 0% - font-lock-fontify-region 4 0% - font-lock-default-fontify-region 4 0% font-lock-extend-region-wholelines 4 0% - # 4 0% font-lock-fontify-region 68 0% - term-insert-char 28 0% jit-lock-after-change 28 0% term-move-columns 379 3% - vertical-motion 363 3% - jit-lock-function 317 3% - jit-lock-fontify-now 155 1% - run-with-timer 155 1% - run-at-time 100 1% - timer-activate 96 0% - timer--activate 8 0% timer--time-less-p 20 0% timer-set-time 98 0% - jit-lock--run-functions 22 0% - # 22 0% font-lock-fontify-region 20 0% - # 20 0% - font-lock-fontify-region 20 0% - font-lock-default-fontify-region 20 0% - font-lock-extend-region-wholelines 20 0% syntax-propertize-wholelines 20 0% - # 20 0% - font-lock-fontify-region 20 0% font-lock-default-fontify-region 12 0% - # 12 0% - font-lock-fontify-region 12 0% - font-lock-default-fontify-region 12 0% font-lock-extend-region-wholelines 12 0% - # 12 0% - font-lock-fontify-region 12 0% - font-lock-default-fontify-region 12 0% font-lock-unfontify-region 8 0% # 4 0% - # 4 0% - font-lock-fontify-region 4 0% font-lock-set-defaults 235 2% - term-move-columns 10 0% term-move-to-column 137 1% term-handle-deferred-scroll 111 1% jit-lock-after-change 24 0% - redisplay_internal (C function) 8 0% - term--update-term-menu 8 0% - easy-menu-change 8 0% - easy-menu-add-item 8 0% - easy-menu-get-map 8 0% - mapcar 8 0% - # 8 0% easy-menu-lookup-name 8 0% - jit-lock-function 8 0% - jit-lock-fontify-now 8 0% - jit-lock--run-functions 4 0% - # 4 0% - font-lock-fontify-region 4 0% font-lock-set-defaults 4 0% - # 4 0% font-lock-fontify-region 8 0% - eval 4 0% if 12 0% syntax-ppss-flush-cache 12 0% - timer-event-handler 12 0% - apply 4 0% - show-paren-function 4 0% - show-paren--default 4 0% syntax-ppss 8 0% - eval 8 0% if 4 0% - jit-lock-function 4 0% - jit-lock-fontify-now 4 0% - jit-lock--run-functions 4 0% # 347 3% - ... 347 3% Automatic GC 127 1% - command-execute 82 0% - funcall-interactively 77 0% - execute-extended-command 65 0% - command-execute 53 0% - byte-code 26 0% - require 26 0% byte-code 4 0% - read-shell-command 4 0% read-from-minibuffer 8 0% funcall-interactively 4 0% - defvar 4 0% byte-code 4 0% term-send-raw 45 0% - byte-code 45 0% - read-extended-command 45 0% - read-extended-command-1 40 0% - completing-read-default 11 0% - timer-event-handler 11 0% - apply 7 0% # 4 0% - show-paren-function 2 0% show-paren--default 3 0% # 6 0% - timer-event-handler 6 0% - apply 4 0% - # 4 0% - execute-extended-command--shorter 4 0% # 2 0% - show-paren-function 2 0% buffer-match-p 2 0% - redisplay_internal (C function) 2 0% - redisplay--pre-redisplay-functions 2 0% - run-hook-with-args 2 0% redisplay--update-region-highlight --8<---------------cut here---------------end--------------->8--- -- Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5 Fediverse: akib@hostux.social Codeberg: akib emailselfdefense.fsf.org | "Nothing can be secure without encryption."