[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45248: 28.0.50; Emacs freezes with big C functions
From: |
Ravine Var |
Subject: |
bug#45248: 28.0.50; Emacs freezes with big C functions |
Date: |
Fri, 18 Dec 2020 16:47:36 +0530 |
User-agent: |
mu4e 1.5.7; emacs 28.0.50 |
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
- bug#45248: 28.0.50; Emacs freezes with big C functions, Ravine Var, 2020/12/14
- bug#45248: 28.0.50; Emacs freezes with big C functions, Eli Zaretskii, 2020/12/15
- bug#45248: 28.0.50; Emacs freezes with big C functions, Alan Mackenzie, 2020/12/17
- bug#45248: 28.0.50; Emacs freezes with big C functions,
Ravine Var <=
- bug#45248: 28.0.50; Emacs freezes with big C functions, Alan Mackenzie, 2020/12/18
- bug#45248: 28.0.50; Emacs freezes with big C functions, Ravine Var, 2020/12/18
- bug#45248: 28.0.50; Emacs freezes with big C functions, Alan Mackenzie, 2020/12/22
- bug#45248: 28.0.50; Emacs freezes with big C functions, Ravine Var, 2020/12/22
- bug#45248: 28.0.50; Emacs freezes with big C functions, Alan Mackenzie, 2020/12/24