From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Newsgroups: gmane.emacs.bugs Subject: bug#51006: 28.0.60; Slowness while navigating in inferior-python-mode Date: Mon, 04 Oct 2021 21:21:56 +0200 Message-ID: <34996.7429110379$1633375398@news.gmane.org> References: <87fsthympr.fsf@runbox.com> <835yuc7wj2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36368"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: 51006@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 04 21:23:11 2021 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 1mXTYN-0009EE-5Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 21:23:11 +0200 Original-Received: from localhost ([::1]:46592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXTYK-0007d8-PT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 15:23:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXTYF-0007cz-6e for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 15:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXTYE-0002YL-Vr for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 15:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXTYD-0000m8-Nb for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 15:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Oct 2021 19:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51006 X-GNU-PR-Package: emacs Original-Received: via spool by 51006-submit@debbugs.gnu.org id=B51006.16333753342907 (code B ref 51006); Mon, 04 Oct 2021 19:23:01 +0000 Original-Received: (at 51006) by debbugs.gnu.org; 4 Oct 2021 19:22:14 +0000 Original-Received: from localhost ([127.0.0.1]:38400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXTXS-0000kp-89 for submit@debbugs.gnu.org; Mon, 04 Oct 2021 15:22:14 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:57034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXTXM-0000kc-Ug for 51006@debbugs.gnu.org; Mon, 04 Oct 2021 15:22:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=YmufXiJ4luaDhFBoXXAFdTxc7/7zCyEXwN1w4lTRtH4=; b=DRwrTxxtYWjItAMVnF02Yg6oXO QGyGUYnaMtF8kxGJSFMvxirjAQf23DgW0fOp0WMkt+/vbV69ObDH2uoid58M302ogxxR+nT5qOCSU 1geKuYB7Bxw1TXloIwu8fD3FZnYYADbrZz82nzjvmCiL4SKK2hRGQoA2BhxhLkDLLY+rD4hw4tlSl hVr6duLbXzgyf7pFp33j/B0Dfegp0xDp2SShmdyroBqwtp0J4N+PKLvAm6FYYafzMN60snYfZ27b2 Ps9tu6C4P5A8JOU9GAUMUEuD7FlOLDQFLLw+WPh8Hvd1cX4pw8KWe8KoIQZVxC1Kw9EZ10z1/Vgvk 1vMTtqOA==; Original-Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1mXTXL-000690-I8; Mon, 04 Oct 2021 21:22:07 +0200 Original-Received: by submission03.runbox with esmtpsa [Authenticated ID (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1mXTXC-0003tu-3c; Mon, 04 Oct 2021 21:21:58 +0200 In-Reply-To: <835yuc7wj2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Oct 2021 16:24:33 +0300") 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:216386 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Please repeat the profiling experiment, but after loading python.el > (NOT python.elc). This should produce a more detailed profile that > would pinpoint the culprit more accurately. Based on skimming the > source code, my first suspect is syntax-ppss, but that could be a bad > guess. Hi Eli, thanks for the quick response. I repeated the experiment after deleting python.elc to avoid loading it on startup (maybe there's a simpler way of preventing that?). The new profiler report is attached. Another detail: This doesn't happen in the ordinary python-mode, only in inferior-python-mode. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=CPU-Profiler-Report-2021-10-04-21-13-53.txt 47639 95% - python-shell-font-lock-post-command-hook 47639 95% - let 47639 95% - if 47639 95% - progn 47635 95% - let* 47627 95% - let 47623 95% - save-current-buffer 47623 95% - save-current-buffer 47615 95% - let 47611 95% - if 47611 95% - funcall 47611 95% - font-lock-ensure 47611 95% - # 47611 95% - font-lock-fontify-region 47611 95% - font-lock-default-fontify-region 47400 94% - font-lock-fontify-syntactically-region 47400 94% - python-font-lock-syntactic-face-function 47400 94% - if 47400 94% - if 47399 94% - python-info-docstring-p 47387 94% - save-excursion 47096 94% - python-nav-beginning-of-statement 47072 94% - let* 44158 88% - cond 44151 88% - python-nav-beginning-of-statement 44127 88% - let* 41183 82% - cond 41175 82% - python-nav-beginning-of-statement 41133 82% - let* 38429 76% - cond 38421 76% - python-nav-beginning-of-statement 38409 76% - let* 35842 71% - cond 35838 71% - python-nav-beginning-of-statement 35806 71% - let* 33257 66% - cond 33177 66% - python-nav-beginning-of-statement 32662 65% - let* 32414 64% syntax-ppss 124 0% cond 20 0% or 76 0% - save-excursion 68 0% - python-info-line-ends-backslash-p 64 0% - save-excursion 56 0% - while 56 0% - and 56 0% - nth 56 0% - or 52 0% syntax-ppss 2525 5% - syntax-ppss 12 0% # 20 0% - or 8 0% nth 8 0% - let 4 0% and 2551 5% syntax-ppss 4 0% - or 4 0% nth 2672 5% - syntax-ppss 4 0% # 4 0% or 4 0% - save-excursion 4 0% - python-info-line-ends-backslash-p 4 0% - save-excursion 4 0% - while 4 0% - and 4 0% - nth 4 0% - or 4 0% syntax-ppss 2916 5% - syntax-ppss 4 0% # 8 0% - or 4 0% nth 2886 5% syntax-ppss 4 0% - or 4 0% nth 271 0% - let 217 0% - if 213 0% - and 173 0% - not 169 0% - python-info-assignment-statement-p 165 0% - save-excursion 165 0% - let 137 0% - if 133 0% - python-nav-beginning-of-statement 113 0% - let* 77 0% - cond 65 0% - save-excursion 61 0% - python-info-line-ends-backslash-p 48 0% - save-excursion 36 0% - while 32 0% - and 28 0% - nth 28 0% - or 28 0% syntax-ppss 8 0% - if 4 0% equal 24 0% syntax-ppss 8 0% or 20 0% - while 20 0% - and 8 0% re-search-forward 24 0% looking-at-p 4 0% concat 8 0% if 84 0% - font-lock-fontify-keywords-region 84 0% - # 84 0% - let 4 0% - if 4 0% - or 4 0% - nth 4 0% - or 4 0% syntax-ppss 8 0% - if 8 0% - progn 8 0% - font-lock-mode 8 0% - font-lock-default-function 8 0% - font-lock-mode-internal 8 0% - font-lock-unfontify-buffer 8 0% - font-lock-default-unfontify-buffer 8 0% font-lock-unfontify-region 4 0% python-shell-get-process-or-error 8 0% - while 8 0% - let* 4 0% or 4 0% set-text-properties 2364 4% + ... 47 0% + command-execute 3 0% + redisplay_internal (C function) --=-=-=--