unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alin Soare <as1789@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: line buffer as Red Black Trees instead of linear
Date: Wed, 21 May 2014 19:00:49 +0300	[thread overview]
Message-ID: <CA+Xtq3VydeF_qtMacmMQX_LydQVXhajDoNTbp-Q7gWL_em47kw@mail.gmail.com> (raw)
In-Reply-To: <83ha4jnotl.fsf@gnu.org>

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

2014-05-21 18:17 GMT+03:00 Eli Zaretskii <eliz@gnu.org>:

> > Date: Wed, 21 May 2014 11:34:10 +0300
> > From: Alin Soare <as1789@gmail.com>
> > Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
> >
> > Ideally, at each node all the text should have the same properties
> (marks,
> > fonts, etc), and chaging 1 such property can be implemented by splitting
> > the node or removing a few nodes, and their text be preserved in 1 node
> > (only the field owner must be changed when a few nodes are joined in only
> > 1).
>
> That would mean we will need to rearrange the tree each time text
> properties or overlays change, something we avoid today.
>

Yes, each time ! But however, a simple mental computation is still much
faster than now, because the computation is made only 1 for each change,
and there will be lots of simple pre-computations that never repeat. Not
all the attributes will be pre-computed at the creation of the node. Some
attributes, like # of newlines on the text at the left of the node and on
the self will be precomputed at the creation. The Node->marks will be
perhaps precomputed when some mark is added in the text within the node.
Display props are pre-computed when the redisplay-internal requires it, so
kind of lazy.


> Also please note that 'display' properties can specify that Emacs
> displays something entirely different from buffer text, so the display
> engine will still need to consult Lisp strings, in addition to the
> text.  (Yes, it's lots of fun.)
>


What is displayed will be all the time pre-computed for each node, and this
will never be re-computed for that node before modifications. The attribute
NODE->what-to-display-data perhaps will be evaluated at the 1st display,
not at the node creation.

Note also that I will do such that each node keeps not a block of text, but
a linked list of blocks of text, such that to be fast to manipulate
operations like join and split.

Apart from search in buffer and reading the text at a given offset(point),
that will be a little slower because the problem of page cache, all the
other functions will be faster (at a first sight).

We will see. When i start working, I will send you private message to ask
you to read what I did. Try since October on to do it.

[-- Attachment #2: Type: text/html, Size: 3169 bytes --]

  reply	other threads:[~2014-05-21 16:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 14:33 line buffer as Red Black Trees instead of linear Alin Soare
2014-05-15 17:15 ` Alin Soare
2014-05-15 19:17 ` Stefan Monnier
2014-05-15 19:47   ` Alin Soare
2014-05-15 20:06     ` Eli Zaretskii
2014-05-15 20:38       ` Slow redisplay with long lines Stefan Monnier
2014-05-15 20:57         ` Stephan Mueller
2014-05-16  5:40           ` Eli Zaretskii
2014-05-16 18:08             ` Stephan Mueller
2014-05-16 20:36               ` Eli Zaretskii
2014-05-16  5:39         ` Eli Zaretskii
2014-05-15 23:40       ` line buffer as Red Black Trees instead of linear Alin Soare
2014-05-16  5:41         ` Eli Zaretskii
2014-05-16  7:44           ` Alin Soare
2014-05-16  8:28             ` Eli Zaretskii
2014-05-16  8:53               ` Alin Soare
2014-05-16  9:24                 ` Thien-Thi Nguyen
2014-05-21  8:34                 ` Alin Soare
2014-05-21 15:17                   ` Eli Zaretskii
2014-05-21 16:00                     ` Alin Soare [this message]
2014-05-21 17:03                       ` Eli Zaretskii
2014-05-22  9:33                         ` Alin Soare

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=CA+Xtq3VydeF_qtMacmMQX_LydQVXhajDoNTbp-Q7gWL_em47kw@mail.gmail.com \
    --to=as1789@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).