unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ravine Var <ravine.var@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 45248@debbugs.gnu.org
Subject: bug#45248: 28.0.50; Emacs freezes with big C functions
Date: Fri, 18 Dec 2020 16:47:36 +0530	[thread overview]
Message-ID: <87lfdvmjpw.fsf@gmail.com> (raw)
In-Reply-To: <X9t0cm6EgAszn4Hf@ACM>

Alan Mackenzie <acm@muc.de> writes:
> As Eli surmised, the problem is the very large static struct in the
> function.
>
> The solution appears to be to cache positions within structs, so that
> the function searching back over brace lists needn't do so repeatedly in
> the same piece of buffer.
>
> I'm hoping that the following patch which implements this cache will
> solve the problem.  Would you please apply it to your copy of the master
> branch, byte compile it, and try it out on various CC Mode buffers.
> Then please let me know how well it has fixed the bug.  Thanks!

The patch didn't apply cleanly on master, but it still went through.

progmodes $ patch -p1 < ~/Downloads/patches/bug_45248_message_11.mbox
patching file cc-engine.el
Hunk #1 succeeded at 3567 (offset -7 lines).
Hunk #2 succeeded at 11616 (offset -12 lines).
Hunk #3 succeeded at 11825 (offset -12 lines).
Hunk #4 succeeded at 11909 (offset -12 lines).
patching file cc-mode.el
Hunk #1 succeeded at 639 with fuzz 2 (offset 12 lines).
Hunk #2 succeeded at 2056 (offset 20 lines).
Hunk #3 succeeded at 2209 (offset 22 lines).
Hunk #4 succeeded at 2229 (offset 22 lines).
Hunk #5 succeeded at 2271 (offset 22 lines).


Testing with the large structure copied into a file showed
some initial improvement, but the screen still locked up
once scrolling reached 15% or so.

Enabling fast-but-imprecise-scrolling allowed scrolling
to happen, but there was lots of stuttering.

Profile report with emacs -Q on a Ryzen-based machine
(no fast-but-imprecise-scrolling):

https://gist.github.com/ravine-var/0116c20477dce725b02543a85e91cbab





  reply	other threads:[~2020-12-18 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15  3:59 bug#45248: 28.0.50; Emacs freezes with big C functions Ravine Var
2020-12-15 16:05 ` Eli Zaretskii
2020-12-17 15:08 ` Alan Mackenzie
2020-12-18 11:17   ` Ravine Var [this message]
2020-12-18 17:29     ` Alan Mackenzie
2020-12-19  4:28       ` Ravine Var
2020-12-22 20:40         ` Alan Mackenzie
2020-12-23  3:18           ` Ravine Var
2020-12-24 11:50             ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfdvmjpw.fsf@gmail.com \
    --to=ravine.var@gmail.com \
    --cc=45248@debbugs.gnu.org \
    --cc=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).