unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, mithraeum <mithraeum@protonmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Performance degradation from long lines
Date: Fri, 26 Oct 2018 15:00:09 +0800	[thread overview]
Message-ID: <87va5pkxae.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <83lg6mqdfh.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4953 bytes --]


 > > It also seems better than, or at least a viable alternative to, opening
 > > files with M-x find-file-literally, which loses font-lock and leaves
 > > the buffer stuck in Fundamental mode.

 > Again, only if the result of the "simplified" display will be more
 > acceptable than Fundamental mode by enough users.  The significant
 > advantage of find-file-literally is that it already exists, and so
 > incurs exactly zero costs.

I would like to point out that the long line problem also exists for
non-file buffers.
Specifically, evaluating debug-on-entry for org-mode buffer parsing
functions often leads to ridiculously long lines (pretty much the whole
buffer is transformed into a single line), which takes forever to
display.
find-file-literally does not help with this problem at all.

Best,
Ihor


Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Wed, 24 Oct 2018 23:59:02 +0000
>> From: mithraeum <mithraeum@protonmail.com>
>> 
>> In the case of gui Emacs, the reduction of display capability is real,
>> but it seems prefereable to freezing Emacs or slowing it down to a crawl.
>
> It is only preferable if the resulting display will be acceptable by
> enough users to justify the costs of developing and maintaining the
> separate "simplified" display code.
>
>> It also seems better than, or at least a viable alternative to, opening
>> files with M-x find-file-literally, which loses font-lock and leaves
>> the buffer stuck in Fundamental mode.
>
> Again, only if the result of the "simplified" display will be more
> acceptable than Fundamental mode by enough users.  The significant
> advantage of find-file-literally is that it already exists, and so
> incurs exactly zero costs.
>
>> In the r/emacs thread I was encouraged to post to emacs-dev to get
>> the input of more developers, so here I am.
>
> The main motivation for my request to start a discussion here was to
> find out whether such a "simplified" display will be acceptable on GUI
> frames by enough users.  In r/emacs thread, I described some features
> that will be lost (I can repeat here if people prefer that); please
> consult that if you want to make up your mind and provide opinions.
> IMO, the costs for developing and maintaining such a "simplified"
> display code will only be justified if enough people will consider the
> resulting display both acceptable and significantly preferable to what
> find-file-literally already provides.
>
>> First is that Emacs could have a user-configurable timeout after which
>> it could warn the user that it's taking an unexpectedly long time to
>> open a file (or find the end of a line) and ask whether to abort,
>> continue trying, or drop down to a mode with reduced display
>> capabilities (which could be either the equivalent of
>> find-file-literally or the above simplified display techniques, if
>> they're implemented).
>
> First, it isn't visiting the file (i.e. reading it into a buffer) that
> takes time; in fact, the time to visit is almost entirely unaffected
> by line length.  What takes time is the display of the initial
> windowful of the file's text (and following redisplay as result of
> editing).  So I guess the proposal is to have a time-out on that
> initial display and on redisplay cycles.
>
> Second, I'm not sure we need to measure the time; line length is a
> reliable enough indication of expected display slowdown, so we could
> simply look at the typical line lengths instead, which is much
> simpler to implement.
>
> And third, it seems like so-long mode already implements this idea, so
> perhaps we should simply add it to the core and integrate it by
> default.
>
>> The second idea is to use to ignore anything that would slow Emacs
>> down while doing a simple count of the line length, and if the line
>> length so far is over a certain threshold to ask the same questions as
>> above about aborting, continuing, or dropping down to a fail-safe
>> mode.
>
> See above.
>
> Please note that these ideas are a kind of "band-aid": they don't
> solve the root causes for the slow display, they just disable some
> features which make that slow display even slower, and by that make
> the critical line length larger.  But you can still create a file with
> lines so long that even in Fundamental mode it will be painfully slow
> to move through and edit.
>
>> The third is to use some of Emacs' new async abilities to try to open
>> the file.  It might still take forever to open, but at least it shouldn't
>> freeze all of Emacs in the meantime.
>
> There are no such abilities; the concurrency features in Emacs 26
> don't allow running the display code in a separate thread.  Emacs Lisp
> threads are mostly cooperative, and only one thread is allowed to run
> at any given time.  And the current design of Emacs is such that
> redisplay must run from a Lisp thread.
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  parent reply	other threads:[~2018-10-26  7:00 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 23:59 Performance degradation from long lines mithraeum
2018-10-25  0:27 ` Stefan Monnier
2018-10-25 15:02   ` Eli Zaretskii
2018-10-25 15:37     ` Stefan Monnier
2018-10-25  3:26 ` Phil Sainty
2018-10-25 12:44   ` Stefan Monnier
2018-10-25 13:23     ` Eli Zaretskii
2018-10-25 13:30       ` Stefan Monnier
2018-10-25 15:08         ` Eli Zaretskii
2018-10-25 22:34           ` Phil Sainty
2018-10-26  6:36             ` Eli Zaretskii
2018-10-26 12:48             ` Stefan Monnier
2018-10-27  8:38               ` Phil Sainty
2018-10-27 15:32                 ` Drew Adams
2018-10-28  1:51                   ` Phil Sainty
2018-10-28  1:58                     ` Drew Adams
2018-10-27 22:18                 ` Stefan Monnier
2018-12-08 23:08                 ` Stefan Monnier
2018-12-09 14:40                   ` Phil Sainty
2018-12-30  4:07                     ` Phil Sainty
2019-01-12  1:03                       ` Phil Sainty
2019-01-12 11:08                         ` Eli Zaretskii
2019-03-10 10:22                           ` Phil Sainty
2019-03-10 12:58                             ` Eli Zaretskii
2019-03-10 13:36                               ` martin rudalics
2019-03-10 13:46                                 ` Eli Zaretskii
2019-03-10 23:16                                   ` Phil Sainty
2019-03-10 18:06                                 ` Stefan Monnier
2019-03-11  9:14                                   ` martin rudalics
2019-03-10 23:31                               ` Phil Sainty
2019-03-11  3:35                                 ` Eli Zaretskii
2019-03-11  3:48                                   ` Phil Sainty
2019-03-11 14:35                                     ` Eli Zaretskii
2018-10-26  1:46   ` mithraeum
2018-10-26  2:39     ` Phil Sainty
2018-10-26  2:58       ` mithraeum
2018-10-26  4:43         ` Phil Sainty
2018-10-26  5:54           ` mithraeum
2018-10-26  2:54     ` Phil Sainty
2018-10-26 15:18       ` Stefan Monnier
2018-10-27  3:10     ` Phil Sainty
2018-10-27 22:15       ` Stefan Monnier
2018-12-30  5:23         ` Phil Sainty
2018-10-28  2:03   ` Phil Sainty
2018-10-25 15:00 ` Eli Zaretskii
2018-10-25 17:18   ` Michael Heerdegen
2018-10-25 17:30     ` Eli Zaretskii
2018-10-26  0:59     ` mithraeum
2018-10-26  6:48       ` Eli Zaretskii
2018-10-26  7:00   ` Ihor Radchenko [this message]
2018-10-26  7:28     ` Eli Zaretskii
2018-10-26  7:36       ` Ihor Radchenko
2018-10-26  7:57         ` Eli Zaretskii
2018-10-26  8:05           ` Ihor Radchenko
2018-10-26  8:46             ` Eli Zaretskii
2018-10-26  8:58               ` Ihor Radchenko
2018-10-26  9:08                 ` Eli Zaretskii
2018-10-26  9:46                   ` Noam Postavsky
2018-10-26 12:35                     ` Eli Zaretskii
2018-10-26 15:09                 ` Stefan Monnier
2018-10-26  9:52               ` mithraeum
2018-10-26  8:05         ` mithraeum
2018-10-26 16:05     ` Gemini Lasswell
2018-10-31 13:05       ` Ihor Radchenko
2018-10-31 15:49         ` Eli Zaretskii
2018-10-25 17:53 ` Clément Pit-Claudel
2018-10-25 19:14   ` Eli Zaretskii
2018-10-25 19:17     ` Clément Pit-Claudel
2018-10-26  6:40 ` mithraeum
2018-10-26  7:26   ` Eli Zaretskii
2018-10-26  7:47     ` mithraeum
2018-10-26  8:30       ` Eli Zaretskii
2018-10-26  8:56         ` mithraeum
2018-10-26  9:06           ` Eli Zaretskii
2018-10-26 15:29           ` Stefan Monnier
2018-10-26 15:34 ` Alexander Shukaev
2018-10-26 16:18   ` Stefan Monnier
2018-10-26 16:50     ` Alexander Shukaev
2018-10-26 17:27       ` Stefan Monnier
2018-10-27  2:09   ` Phil Sainty
     [not found] <20190107065207.21793.53271@vcs0.savannah.gnu.org>
     [not found] ` <20190107065208.BA36C21736@vcs0.savannah.gnu.org>
2019-01-10 18:07   ` [Emacs-diffs] scratch/so-long 7273fb2: Add so-long library Stefan Monnier
2019-01-12  2:20     ` Phil Sainty
2019-01-12 15:11       ` Stefan Monnier
2019-04-14 13:09         ` Phil Sainty
2019-04-14 15:14           ` Stefan Monnier
2019-04-14 22:33             ` Phil Sainty
2019-06-27 13:46               ` Performance degradation from long lines Phil Sainty
2019-07-06 14:18                 ` Phil Sainty
2019-07-13  8:07                   ` Eli Zaretskii
2019-07-13  9:07                     ` Stefan Kangas
2019-07-13  9:51                       ` Eli Zaretskii
2019-07-13 10:23                         ` Stefan Kangas
2019-07-13 10:29                           ` Eli Zaretskii
2019-07-13 10:38                             ` Stefan Kangas
2019-07-13 10:58                               ` Phil Sainty
2019-07-13 11:23                                 ` Eli Zaretskii
2019-07-13 11:23                               ` Eli Zaretskii
2019-07-13  9:33                     ` Phil Sainty
2019-07-13  9:56                       ` Eli Zaretskii
2019-07-13 13:31                         ` Stefan Monnier
2019-07-13 13:43                           ` Stefan Kangas
2019-07-13 14:14                           ` Eli Zaretskii
2019-07-13 14:17                             ` Stefan Monnier
2019-07-13 18:17                               ` Eli Zaretskii
2019-07-13 22:22                                 ` Stefan Monnier
2019-07-14  5:39                                   ` Eli Zaretskii
2019-07-15 13:12                                     ` Dmitry Gutov
2019-07-18  6:30                                       ` Eli Zaretskii
2019-07-18 14:48                                         ` Stefan Monnier
2019-07-18 17:11                                           ` Clément Pit-Claudel
2019-07-18 18:11                                             ` Stefan Monnier
2019-07-18 18:33                                           ` Andy Moreton

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=87va5pkxae.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me \
    --to=yantar92@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mithraeum@protonmail.com \
    /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).