From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43631: 28.0.50; CC Mode multiline strings grinds performance to a halt Date: Sat, 26 Sep 2020 14:40:36 +0200 Message-ID: <87eemo4sor.fsf@thornhill.no> References: <87lfgwwzw6.fsf@thornhill.no> <83pn68rcio.fsf@gnu.org> Reply-To: Theodor Thornhill 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="9369"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43631@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 26 14:41:13 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 1kM9Vo-0002KN-QZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Sep 2020 14:41:12 +0200 Original-Received: from localhost ([::1]:33520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kM9Vn-0000a8-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Sep 2020 08:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kM9Ve-0000Xb-M0 for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2020 08:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kM9Ve-0004lr-Cj for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2020 08:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kM9Ve-0002e1-As for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2020 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Sep 2020 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43631 X-GNU-PR-Package: emacs Original-Received: via spool by 43631-submit@debbugs.gnu.org id=B43631.160112403610126 (code B ref 43631); Sat, 26 Sep 2020 12:41:02 +0000 Original-Received: (at 43631) by debbugs.gnu.org; 26 Sep 2020 12:40:36 +0000 Original-Received: from localhost ([127.0.0.1]:46026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM9VD-0002dF-Qm for submit@debbugs.gnu.org; Sat, 26 Sep 2020 08:40:36 -0400 Original-Received: from out1.migadu.com ([91.121.223.63]:11516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM9VA-0002d5-Tc for 43631@debbugs.gnu.org; Sat, 26 Sep 2020 08:40:34 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1601124031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=93Kat2P16RhR+BkzJ1BWgPmytHHA7dHanqs58EFA2DI=; b=mS0BSJIiWFbZsU+iIs3u/vIbKlavVvxf1YjSNGLJM5DJzS5KhamWXOQDKXO0QCjYZb0vql INgCz0VGYy6bsQHR90vvJe8g+8UD5duuDC+K/ReT+ql9O8Foajqh1dB3v+nIoICCf0P13v rxZtom+8Vv8sBwQ4TDmek+nVbPyVfpbnuooOIwrFBXpL0xwSYKGQDmydkIfsQJnOce3QKf Ko/4T0HUK3NIoK7Evb+LaSlVJ6ZCwVmt8ttHOFU/hINHbAThhxOKXmZhRqtGJ+Ynd2BWyD AUmUthOfgc1wMeyER5jmybYfqPnOLAHrxExRy1/q94DNGvwFILU/087nEMbw0w== In-Reply-To: <83pn68rcio.fsf@gnu.org> 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:189016 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > All the profiles posted there end prematurely, thus making it > impossible to make independent conclusions regarding the possible > culprits. Would it be possible to post here a full profile, > completely expanded, obtained after loading all the relevant *.el > files as *.el (NOT *.elc!), so that the profile is detailed enough to > show the relevant parts? It would make the discussion much more > focused. > > Bonus points for posting another profile, where the feature you think > is the main culprit is disabled. > > TIA Attached is two reports, one which is super slow, and one that is fast. Recipe: - git clone https://github.com/unhammer/csharp-mode/ - git checkout 164-repro - eval csharp-mode.el - open superslow.cs and write some text - rinse, repeat, but with (c-lang-defconst c-multiline-string-start-char csharp ?@) commented out. One is unbearably slow, the other is super fast. Hope this helps a little! All the best, Theodor Thornhill --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=not-slow-without-multiline.txt Content-Transfer-Encoding: quoted-printable [profiler-profile "24.3" cpu #s(hash-table size 65 test equal rehash-size 1= .5 rehash-threshold 0.8125 data ([redisplay sit-for execute-extended-comman= d funcall-interactively call-interactively command-execute nil nil nil nil = nil nil nil nil nil nil] 1 [progn unwind-protect let and if save-restrictio= n if progn if let c-beginning-of-macro and let* progn unwind-protect let*] = 1 [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 17 [fon= t-lock-fontify-syntactically-region font-lock-default-fontify-region funcal= l progn unwind-protect let* progn unwind-protect let* let save-restriction = c-font-lock-fontify-region font-lock-fontify-region "#" run-hook-wrapped jit-lock--run-functions] 1 [progn cond let* save-= excursion progn unwind-protect let c-invalidate-sws-region-before save-excu= rsion progn unwind-protect progn unwind-protect let save-restriction if] 1 = [self-insert-command funcall-interactively call-interactively command-execu= te nil nil nil nil nil nil nil nil nil nil nil nil] 1 [save-restriction pro= gn if c-extend-after-change-region font-lock-extend-jit-lock-region-after-c= hange run-hook-with-args jit-lock-after-change self-insert-command funcall-= interactively call-interactively command-execute nil nil nil nil nil] 1 [re= ad-from-minibuffer completing-read-default completing-read read-extended-co= mmand byte-code call-interactively command-execute nil nil nil nil nil nil = nil nil nil] 2 [completing-read-default completing-read read-extended-comma= nd byte-code call-interactively command-execute nil nil nil nil nil nil nil= nil nil nil] 2 [Automatic\ GC] 11)) (24431 13788 861111 419000) nil] --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=report-slow-with-multiline.txt Content-Transfer-Encoding: quoted-printable [profiler-profile "24.3" cpu #s(hash-table size 65 test equal rehash-size 1= .5 rehash-threshold 0.8125 data ([sit-for execute-extended-command funcall-= interactively call-interactively command-execute nil nil nil nil nil nil ni= l nil nil nil nil] 1 [progn while let* c-pps-to-string-delim progn and whil= e progn if cond let* progn unwind-protect let* c-before-change-check-unbala= nced-strings funcall] 1212 [setq cond progn and while condition-case let c-= syntactic-re-search-forward and while progn and while progn if cond] 1 [c-p= ps-to-string-delim progn and while progn if cond let* progn unwind-protect = let* c-before-change-check-unbalanced-strings funcall "#" mapc if] 2 [unwind-protect let save-excursion cond progn and while c= ondition-case let c-syntactic-re-search-forward and while progn and while p= rogn] 1 [remove-text-properties progn if while let c-clear-char-property-wi= th-value-on-char-function progn if let* progn unwind-protect let* c-parse-q= uotes-before-change funcall "#" mapc] 1 [progn whil= e let* c-pps-to-string-delim cond let* progn unwind-protect let* c-before-c= hange-check-unbalanced-strings funcall "#" mapc if = save-excursion progn] 3 [progn and while progn and while progn if cond let*= progn unwind-protect let* c-before-change-check-unbalanced-strings funcall= "#"] 2 [setq progn and while condition-case let c-= syntactic-re-search-forward and while progn and while progn if cond let*] 1= [progn and while condition-case let c-syntactic-re-search-forward and whil= e progn and while progn if cond let* progn] 1 [setq while progn if let save= -restriction save-excursion c-parse-ps-state-below setq progn if let* progn= unwind-protect let save-restriction] 2 [nil nil nil nil nil nil nil nil ni= l nil nil nil nil nil nil nil] 2 [set-match-data unwind-protect let progn i= f save-restriction if progn if let c-beginning-of-macro progn unwind-protec= t let save-excursion cond] 1 [let if c-invalidate-state-cache-1 if c-invali= date-state-cache cond while save-restriction let* progn unwind-protect let*= c-parse-quotes-after-change funcall "#" mapc] 2 [= if if while let* progn unwind-protect let* if c-after-change-mark-abnormal-= strings funcall "#" mapc save-excursion progn unwi= nd-protect progn] 5 [goto-char let* c-pps-to-string-delim progn and while p= rogn if cond let* progn unwind-protect let* c-before-change-check-unbalance= d-strings funcall "#"] 1 [if progn and while condit= ion-case let c-syntactic-re-search-forward and while progn and while progn = if cond let*] 4 [and if progn while progn unwind-protect let progn if save-= restriction if progn if let c-beginning-of-macro progn] 2 [if progn if let = c-beginning-of-macro progn unwind-protect let save-excursion cond progn and= while condition-case let c-syntactic-re-search-forward] 2 [save-restrictio= n if progn if let c-beginning-of-macro progn unwind-protect let save-excurs= ion cond progn and while condition-case let] 2 [let and if save-restriction= if progn if let c-beginning-of-macro progn unwind-protect let save-excursi= on cond progn and] 2 [cond progn and while condition-case let c-syntactic-r= e-search-forward and while progn and while progn if cond let*] 1 [and if le= t c-backward-sws c-determine-limit-get-base let* save-excursion c-determine= -limit setq if let c-fl-decl-start or setq if c-change-expand-fl-region] 1 = [let* c-pps-to-string-delim progn and while progn if cond let* progn unwind= -protect let* c-before-change-check-unbalanced-strings funcall "#" mapc] 1 [assq cdr looking-at if if while let* progn unwind-= protect let* if c-after-change-mark-abnormal-strings funcall "#" mapc save-excursion] 1 [let c-syntactic-re-search-forward an= d while progn and while progn if cond let* progn unwind-protect let* c-befo= re-change-check-unbalanced-strings funcall] 1 [setq c-truncate-lit-pos-cach= e c-clear-syn-tab progn and while progn and while progn if cond let* progn = unwind-protect let*] 1 [c-clear-syn-tab if progn while let* c-pps-to-string= -delim progn and while progn if cond let* progn unwind-protect let*] 2 [cha= r-before eq while progn while progn unwind-protect let progn if save-restri= ction if progn if let c-beginning-of-macro] 1 [c-syntactic-re-search-forwar= d and while progn and while progn if cond let* progn unwind-protect let* c-= before-change-check-unbalanced-strings funcall "#"]= 2 [setq c-truncate-lit-pos-cache c-invalidate-state-cache-1 if c-invalidat= e-state-cache cond while save-restriction let* progn unwind-protect let* c-= parse-quotes-after-change funcall "#" mapc] 1 [and= while save-restriction let* progn unwind-protect let* c-parse-quotes-after= -change funcall "#" mapc save-excursion progn unwi= nd-protect progn unwind-protect] 1 [not save-excursion cond while save-rest= riction let* progn unwind-protect let* c-parse-quotes-after-change funcall = "#" mapc save-excursion progn unwind-protect] 1 [s= etq progn while progn and while let* progn unwind-protect let* if c-after-c= hange-mark-abnormal-strings funcall "#" mapc save-= excursion] 1 [c-truncate-lit-pos-cache c-invalidate-state-cache-1 if c-inva= lidate-state-cache cond while save-restriction let* progn unwind-protect le= t* c-parse-quotes-after-change funcall "#" mapc sa= ve-excursion] 1 [save-excursion cond progn and while condition-case let c-s= yntactic-re-search-forward and while progn and while progn if cond] 1 [unwi= nd-protect let and if save-restriction if progn if let c-beginning-of-macro= progn unwind-protect let save-excursion cond progn] 1 [while let* progn un= wind-protect let* if c-after-change-mark-abnormal-strings funcall "#" mapc save-excursion progn unwind-protect progn unwind-p= rotect let] 1 [completing-read-default completing-read read-extended-comman= d byte-code call-interactively command-execute nil nil nil nil nil nil nil = nil nil nil] 4 [Automatic\ GC] 73)) (24431 13704 63591 401000) nil] --=-=-=--