all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Alin Soare <as1789@gmail.com>
Cc: John Wiegley <jwiegley@gmail.com>,
	Brandon Invergo <brandon@invergo.net>,
	emacs-devel@gnu.org
Subject: Re: as the accident occued...  long lines in emacs buffers.
Date: Fri, 13 Nov 2015 17:40:02 +0100	[thread overview]
Message-ID: <87wptln999.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <871tbtoo49.fsf@fencepost.gnu.org> (David Kastrup's message of "Fri, 13 Nov 2015 17:33:42 +0100")

David Kastrup <dak@gnu.org> writes:

> Alin Soare <as1789@gmail.com> writes:
>
>> Hi Emacs Devel.
>>
>> I have just sent on emacs devel a message that was destinated elsewhere.
>>
>> Because the accident occurred, I want to remember you that I intend to
>> solve the issue of long lines in emacs, by replacing the linear buffer
>> with red-black trees that keep the lines.
>>
>> This will make emacs work incredible fast with long lines.
>
> I'll settle for "as fast as one would expect given its behavior on short
> lines".

Though purportedly this should have been somewhat addressed by

cache-long-scans is a variable defined in ‘C source code’.
Its value is t

  Automatically becomes buffer-local when set.

Documentation:
Non-nil means that Emacs should use caches in attempt to speedup buffer scans.

There is no reason to set this to nil except for debugging purposes.

Normally, the line-motion functions work by scanning the buffer for
newlines.  Columnar operations (like ‘move-to-column’ and
‘compute-motion’) also work by scanning the buffer, summing character
widths as they go.  This works well for ordinary text, but if the
buffer’s lines are very long (say, more than 500 characters), these
motion functions will take longer to execute.  Emacs may also take
longer to update the display.

If ‘cache-long-scans’ is non-nil, these motion functions cache the
results of their scans, and consult the cache to avoid rescanning
regions of the buffer until the text is modified.  The caches are most
beneficial when they prevent the most searching---that is, when the
buffer contains long lines and large regions of characters with the
same, fixed screen width.

When ‘cache-long-scans’ is non-nil, processing short lines will
become slightly slower (because of the overhead of consulting the
cache), and the caches will use memory roughly proportional to the
number of newlines and characters whose screen width varies.

Bidirectional editing also requires buffer scans to find paragraph
separators.  If you have large paragraphs or no paragraph separators
at all, these scans may be slow.  If ‘cache-long-scans’ is non-nil,
results of these scans are cached.  This doesn’t help too much if
paragraphs are of the reasonable (few thousands of characters) size.

The caches require no explicit maintenance; their accuracy is
maintained internally by the Emacs primitives.  Enabling or disabling
the cache should not affect the behavior of any of the motion
functions; it should only affect their performance.

[back]

-- 
David Kastrup



  reply	other threads:[~2015-11-13 16:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87k2q1xsg9.fsf@gmail.com>
     [not found] ` <1446668449.11811.11.camel@invergo.net>
     [not found]   ` <87mvupvonu.fsf@gmail.com>
     [not found]     ` <1447368233.11811.52.camel@invergo.net>
     [not found]       ` <87wptmyaml.fsf@gmail.com>
     [not found]         ` <1447409234.32571.1.camel@invergo.net>
2015-11-13 15:28           ` The Little Computer alin
     [not found]             ` <m24mgp7v7i.fsf@Vulcan.attlocal.net>
2015-11-13 16:27               ` as the accident occued... long lines in emacs buffers Alin Soare
2015-11-13 16:33                 ` David Kastrup
2015-11-13 16:40                   ` David Kastrup [this message]
2015-11-13 17:39                     ` alin
2015-11-13 18:50                     ` Eli Zaretskii
2015-11-13 19:01                       ` alin
2015-11-13 19:09                       ` alin
2015-11-13 16:46                   ` alin

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wptln999.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=as1789@gmail.com \
    --cc=brandon@invergo.net \
    --cc=emacs-devel@gnu.org \
    --cc=jwiegley@gmail.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.