Subject: Re: bug#38407: 27.0.50; infinite loop with display of large file without newlines

From: Pieter van Oostrum <[email-masked]>
Date: Thu, 28 Nov 2019 07:51:33 +0100

Phil Sainty wrote:

 > On 2019-11-28 10:52, Pieter van Oostrum wrote:
 > > I used a 100KB json file from my Firefox profile
 > 
 > Out of interest I went looking for large JSON files in my own Firefox
 > profiles, and the largest one I could find was an "extensions.json"
 > which was also roughly 100K.  Curiously enough, everything was indeed
 > dramatically slower than normal in that buffer, even in so-long-mode.
 > 
 > I also observed that many different human languages were present in
 > the text, so I thought that bi-directional text processing might be a
 > factor -- and indeed setting the debug option bidi-display-reordering
 > to nil in that buffer made a *very* dramatic improvement to
 > performance.
 > 
 > Similarly, performance was good after using M-x find-file-literally
 > to visit the file.
 > 
 > I am guessing that this is also what is happening for you?

It was exactly that file that caused the problem. I copied it to a .txt file to see if the problem might have been caused by the Javascript mode, and it didn't make any difference.

Normally I wouldn't open such a bizarre file, but I was doing an 'rgrep' on my home directory, and this was one of the files that came up in the grep results. When I was scrolling though the *grep* buffer, I got this problem. Then I decided to just open the file, to eliminate the possibility that grep-mode was one of the causes.

And yes, I checked it all with emacs -Q.

I forgot to mention that when I set debug-on-quit, a Quit indicated Emacs was in redisplay_internal.

-- 
Pieter van Oostrum <[email-masked]>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]