From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48871: 27.2; Unusably slow in C# mode Date: Sun, 6 Jun 2021 13:32:09 +0100 Message-ID: Reply-To: jan Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21394"; mail-complaints-to="usenet@ciao.gmane.io" To: 48871@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 06 14:33:10 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 1lprxl-0005H7-Qm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 14:33:09 +0200 Original-Received: from localhost ([::1]:47688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lprxk-0001UB-Sl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 08:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lprxe-0001Tq-Sp for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 08:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lprxe-0004yg-MU for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 08:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lprxe-0004oF-GN for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 08:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: jan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jun 2021 12:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48871 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.162298274318434 (code B ref -1); Sun, 06 Jun 2021 12:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jun 2021 12:32:23 +0000 Original-Received: from localhost ([127.0.0.1]:50929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lprwx-0004nD-51 for submit@debbugs.gnu.org; Sun, 06 Jun 2021 08:32:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lprwr-0004n1-Ns for submit@debbugs.gnu.org; Sun, 06 Jun 2021 08:32:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lprwr-0001IC-Ew for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 08:32:13 -0400 Original-Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:41693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lprwp-0004SB-Hf for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 08:32:13 -0400 Original-Received: by mail-pj1-x1029.google.com with SMTP id b15-20020a17090a550fb029015dad75163dso8709735pji.0 for ; Sun, 06 Jun 2021 05:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=tPCrtcBu1mlybMNMACwuR/rJRbBlBgPBilm3/PQ1AH0=; b=UjezA78vtsKKuAEtBG55FqCY4Mc5INTQ3JHTsNy9YD0P1OH4JMo68uhJnSc+YCs7Xx WhicGp7m5GMQwoMmqtMbRCAsFN0vyK/GAj38vuFQPyi5tA41qG/yaDeWSQxXTWKx6wzm SfGHTJ7v5k4S5JqbeFsHChSqloFf9EcDWQunxX6ePR6tFXA6VcAQmbG5tB+DJhAE+DQB KBWqefnhd695diUuzKZtKsmOgbWeg6sFFrRkcoK+H8en8tzmVnM5tsaGjWXgHxe6RQHd S3OcXMGWD/AnmAs7WYJgSxhyyhUowYHRKUpUaTyAXfB1g0zvI8eQUJpkYGTKyRKvuue7 hLzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tPCrtcBu1mlybMNMACwuR/rJRbBlBgPBilm3/PQ1AH0=; b=nzHPtfaQE5gFdljVsFiq1yX6UWbPE6bvjV0cUdGMwLckHYP1qTKtWPbwNj2BVl5bzL SeDHb3MLOUHmq6NHFZsPo+Q+yLvzLl138ihb2BDpZ+oB3qwU9+II7VL5VlrF9H3CT2Ds 5Hr3zam+bUGhBIalBtfnF4Llia9tpwGmzM0hK7cLaDZF4Ht+JRskxoehkHJDieSDEs/S PaOHE00PnHbokrsL2PNwaMoulrw0Vg2jAh9Mb8CAMAU+jNZWpnJs7VWDgeNkwQ9i/F0i oVBSp1w4komcqiEmyHH5RA6zJQqlB+ucleHC/CqzknsUmwzmolyLk+T8fY9ipr2JQPRe zIdg== X-Gm-Message-State: AOAM530QxueeM/q2WncpB/NpHRN+9KRwsljsdwmVEu9DHKofmhHy7siv +jyYIbRs6XzWga/DHVNyQh1WxCzBlYPsYZETZe9rUN4C X-Google-Smtp-Source: ABdhPJylnRp9H3FwQInkOkwY174YAqr4JhaYvwxO5OXX/kQTn0SoWnzaO/3ZdgIRONJVchdY4fq2iH3HPG5Ur6Uuslo= X-Received: by 2002:a17:90a:a607:: with SMTP id c7mr15226873pjq.199.1622982729551; Sun, 06 Jun 2021 05:32:09 -0700 (PDT) Original-Received: by 2002:a17:90a:aa06:0:0:0:0 with HTTP; Sun, 6 Jun 2021 05:32:09 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=rtm443x@googlemail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:208120 Archived-At: Hi, I use emacs, I'm not an expert. C# mode is slow beyond to the point of being completely unusable. This seems to have started when I upgraded from emacs 26 to emacs 27.2. The file is ~220K. At the start of the file, typing takes 3 or 4 secs *per character* to appear (at the end of the file, instantaneous). It's forcing me to use visual studio to do all simple text editing and I don't like that. If I turn off font lock mode it doesn't improve any. If I switch to fundamental mode it's back to it's snappy self. Turning off Syntactic Indentation and Electric Mode didn't help. I tried removing all comments to see what happened but no luck. I did find this quite recent issue but their solution didn't help because I couldn't find that text in the specified lisp file so couldn't comment it out. I looked on the emacs bug list but found nothing matching (not sure I was doing the search right though). I can provide the c# file but I'd prefer it to not be made public if possible. Turns out emacs has a profiler, thought I'd try it. From did profiler-start, typed some chars (probably 20 to 30 secs locked up before it was finished, immediately did profiler-stop, report is this (heavier parts expanded) - command-execute 1121 97% - call-interactively 1121 97% - funcall-interactively 1114 96% - self-insert-command 889 77% - c-before-change 878 76% - mapc 878 76% - # 878 76% - c-before-change-check-unbalanced-strings 877 76% c-pps-to-string-delim 865 75% - c-syntactic-re-search-forward 11 0% c-beginning-of-macro 4 0% - c-after-change 11 0% - mapc 11 0% - # 11 0% c-after-change-mark-abnormal-strings 4 0% - c-restore-<>-properties 4 0% c-syntactic-re-search-forward 3 0% - c-forward-<>-arglist 1 0% - c-forward-<>-arglist-recur 1 0% c-forward-sws 1 0% - c-change-expand-fl-region 2 0% - c-fl-decl-end 2 0% - c-literal-start 2 0% - c-semi-pp-to-literal 2 0% c-parse-ps-state-below 2 0% c-parse-quotes-after-change 1 0% - newline 223 19% - self-insert-command 223 19% - electric-indent-post-self-insert-function 112 9% - indent-according-to-mode 112 9% - c-indent-line 112 9% - c-shift-line-indentation 112 9% - c-before-change 110 9% + mapc 109 9% c-restore-string-fences 1 0% - c-after-change 2 0% - mapc 2 0% - # 2 0% c-after-change-mark-abnormal-strings 1 0% - c-restore-<>-properties 1 0% c-syntactic-re-search-forward 1 0% - c-before-change 110 9% - mapc 110 9% - # 110 9% - c-before-change-check-unbalanced-strings 110 9% c-pps-to-string-delim 109 9% c-syntactic-re-search-forward 1 0% - c-after-change 1 0% - mapc 1 0% - # 1 0% - c-restore-<>-properties 1 0% c-syntactic-re-search-forward 1 0% - execute-extended-command 2 0% - sit-for 2 0% redisplay 2 0% + byte-code 7 0% - ... 25 2% Automatic GC 25 2% + redisplay_internal (C function) 5 0% Not sure what to do. cheers jan