From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59641: term is very slow Date: Sat, 17 Dec 2022 00:29:02 +0600 Message-ID: <87zgbn2oep.fsf@disroot.org> References: <878rjwmale.fsf@disroot.org> <835yf0p2ba.fsf@gnu.org> Reply-To: Akib Azmain Turja Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12110"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59641@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 16 19:30:26 2022 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 1p6FTV-0002vl-Ez for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Dec 2022 19:30:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6FTD-0003CB-OM; Fri, 16 Dec 2022 13:30:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6FT9-0003C0-2U for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 13:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6FT8-0006Of-P9 for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 13:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6FT8-00058v-4d for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 13:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Akib Azmain Turja Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2022 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59641 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 59641-submit@debbugs.gnu.org id=B59641.167121539119735 (code B ref 59641); Fri, 16 Dec 2022 18:30:02 +0000 Original-Received: (at 59641) by debbugs.gnu.org; 16 Dec 2022 18:29:51 +0000 Original-Received: from localhost ([127.0.0.1]:50860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6FSw-00058F-63 for submit@debbugs.gnu.org; Fri, 16 Dec 2022 13:29:50 -0500 Original-Received: from knopi.disroot.org ([178.21.23.139]:35194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6FSt-000589-J2 for 59641@debbugs.gnu.org; Fri, 16 Dec 2022 13:29:48 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id D145A411D2; Fri, 16 Dec 2022 19:29:45 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MXaJg6I47NBw; Fri, 16 Dec 2022 19:29:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1671215384; bh=CXcouwAeROXYN4ma70hb9VmylroNBLZ/kIiEnia2Hf0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=PbXBgP1Z2EWWlvWT5MLzTK/g5/xCyg9paDiTfIoWFuEbYb2K8SII9oYsM9kL1yNZM sjVEn4pV3cPpPmxN/TUBBexau6ECPRFkqu72et6L/KzQo30oTXRF5+x2uoldcAiFtr PjHi1C53UH7k37awZ4F6Ok/I5Gi3uuwM/cwD4qzLKd8aUkluUgV7al797YGUmJ/K/3 cygkmhvxfAJa0mgTIDa9I4jzmy2xQ4/+xHHYa4uepaqJE+id5ErguNWiQO944omAGa +IZKYsPAqeSnnr9Sc2lFUfE8Sk8MuXlHY5Pwhfqiyrn0fi0JWAnqScl1DmRieBU6Db PRFyxmxW//ruQ== In-Reply-To: <835yf0p2ba.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Nov 2022 22:31:05 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251230 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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" >>=20 >> 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. >>=20 >> I tried to profile Term. Steps: >>=20 >> 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=3D0 ; while true ; do echo $i ; i=3D$((i+1)) ; d= one' >> Note I also run emacs -nw in before this command. >> 5. Wait for finishing. >> 6. M-x profiler-stop >> 7. M-x profiler-report >>=20 >> 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 usefu= l. 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'. ;) ) =2D-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 =2D-8<---------------cut here---------------end--------------->8--- =2D-=20 Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5 Fediverse: akib@hostux.social Codeberg: akib emailselfdefense.fsf.org | "Nothing can be secure without encryption." --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmOcuO8ACgkQVTX89U2I YWs7rhAAhV2Bbhnn/n4gqp7mlA9ak7hcRsipdHiflNFYNLKbxM57+d5fTIPcN8Bf NqOh9idVy0GMNzXrCtLtstqY+n6pdP3GgUmpPrHUXN7uoevfRfsdDNTDEq/uw4XN ElVxVPBYe8q3yPZjqHBdsluga8P+8C/E5XoZN6KBAVYI9O8JdJTTN0Rrz4WEcpiN 76SUBCkuAg0Eeb5jO9o4EhmnKpYG2hwoj3g1OTOCP8kx4FKHNWcVS452I5oN3nNi 2keQvBGJEZPJEQpABWlO1iasaGzkFN6oPRO0tYjt8x9ht8UpLPNBKaSiX4jM7EAx JXmzwbczlT43jOshPOCYbjk9AS7p6f5HGCQoSwj9/BtvaqlEXxY7HxPXRE7gxJoq NXd3RLdE3YttJFeuBazUtACMWJlBeMP9/4aQwjmV5tMpCjgx2NdqEpFTBZE/KUl3 JiynnClQ1EsPd/B1bPzDYu1ZPx1+JPua9Q+Yt4v1KrCDD8URVFJ40oncsP25hfuj 8WTig3K/lV1yqAiUpLd5jPdQkae92DyEq8wp7Ikap3askPaUwAPgZkr1DHnEHmiE FRfGLFL9xyCTh2sRpjw5wx6J1w8NMRVUJFFG3CBqAC7FtLSf5w36Lrymclh5iOTN BjjYAKdz3Dw1jNcNgzCawTpY0Y9ptACB7M4lIR2FVaeTMjgQas8= =vJsU -----END PGP SIGNATURE----- --=-=-=--