emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance degradation from long lines


From: mithraeum
Subject: Re: Performance degradation from long lines
Date: Fri, 26 Oct 2018 01:46:29 +0000

> On 2018-10-25 12:59, mithraeum wrote:
>
> Broadly speaking, this is what so-long.el is about. It does not help
> with the redisplay code itself, but it disables elisp-visible options
> which it considers may affect performance under long-line conditions.
>
> https://savannah.nongnu.org/projects/so-long

I tried out so-long's wip branch on the same files I tested
longlines.el on, and here are the results:

First I tested it on a 268K minified JSON file with 272307 characters
on one line, and it opened in about 3 seconds.

All the text remained on one line, as in the original, but there was
no font-lock, and I was in so-long mode (which, from what I understand,
is much like Fundamental mode), not json-mode.

Then I tried opening the 663K minified JSON file with 671209
characters on one line.  It took a little over 4 minutes to open.
I then tried it again and gave up after about 7 minutes, and when
hitting control-g and escape a bunch of times did nothing, I did a
"kill -s SIGUSR2" on the emacs daemon process and was dropped in to
the debugger, from which I quit and was able to continue using Emacs
as before.

I have no idea how typical these file sizes and line lengths are compared
to what other Emacs users encounter on a regular basis.  I have a feeling
that they're larger than usual, but really I don't know.  In the cases
where the user encounters lines as long as that second test file, it
doesn't really look like a workable solution.

Also, I should mention that this second file had a ton of non-ascii,
unicode characters in it.  I'm not sure if that made a difference, but
it might.

The nice/not-nice aspect of so-long-mode is that, when it works, the
user is still dealing with the original line lengths in the file.
This is advantageous when one wants to see the file as it was.

It's not so great, though, as a lot of the typical editing commands
really aren't geared towards working with lines that long, so it's
much more convenient to work with lines the length provided by
longlines.el

I think in a realistic scenario, when I run across such minified
files, I'd probably want to run them through a beautifier, then
switch them to a mode that supports font-lock (like the native
json-mode), and after I'm done editing re-minify them if need be
(maybe outside of Emacs, or in Emacs but after re-enabling
so-long-mode or longlines.el).

For my own use cases, however, I think most of the time I probably
wouldn't be editing these super long files in the first place,
but just want to view their beautified versions with font-lock on.

In any event, it's great to have both of these options in Emacs
already.  Their presence and usefulness should be more widely known.

If longlines.el needs some updating to make it non-obsolete or
to deal with its own issues, that could be helpful too.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]