File a bug. Let the powers that be decide whether is fix worthy or not.
This way even if it's closed as wont fix, at least when someone does a bug search in the future they'll see that a similar issue has come up.
> From: Eli Zaretskii
> Subject: Re: Performance problems (CPU 100%) with NULs in files
Thanks for the advice, but I have investigated and decided this is probably too unusual to expect any "fix" for it.>
> > From: "Ludwig, Mark" <ludwig.mark@siemens.com>
> > Thread-Topic: Performance problems (CPU 100%) with NULs in files
> > Date: Wed, 21 Sep 2011 21:08:42 +0000
> >
> > What happens is that as I scroll through the file, when the NULs are
> visible, Emacs gets into some intensive processing for a long time
> (minutes, sometimes!). It eventually unwinds and repaints the display,
> but any movement of point sends it into this loop again. I have found
> that M-< or M-> will quickly reposition away from the problem (assuming
> the beginning and/or end of the file do not contain NULs). Most other
> movement operations send it into the loop.
>
> Does it help to visit such files without code conversions, i.e.
>
> M-x find-file-literally RET FILENAME RET
>
> ?
>
> If not, please file a bug report and attach to it an example file that
> causes this slowdown.
What I have found is that the "problem" is due to a "line" of text being extremely long. In the test file I have, it is ~800,000 characters (bytes). (It came to me with NULs, but I can replace those with any other printable character and get the same result.)
What I find is that some movement actions are rather slow -- take 4-7 seconds -- while others are extremely quick. Specifically, the "forward" movement actions (C-e, M-f) are slow, while the "backward" movement actions (C-a, M-b) are instantaneous. Reposition (C-l) is also slow, as are the line-oriented commands (C-p, C-n).
Thinking through the magnitude of the oddity, I don't think it would be reasonable to expect Emacs to handle this any better than it does. It's just gratifying that C-g works, so I can interrupt it when I stumble into some junk, and now that I know which actions are fast and slow, I can work around it.
OTOH, if you guys really think this is worth asking any developer to fix, I'll file a bug report. I don't need to send any data, because it's easy to reproduce this behavior starting with an empty buffer.
Thanks!
Mark