Re: [dev] [sandy] [PATCH] VIM key bindings.

From: Maxime Coste <frrrwww_AT_gmail.com>
Date: Thu, 10 Jul 2014 21:21:43 +0100

On Thu, Jul 10, 2014 at 09:33:53AM -0700, Charlie Kester wrote:
> The problem with linked lists of lines and piece tables has always been
> achieving good locality of reference. Not a problem with buffer gap,
> where locality was the main motivating factor behind the design.

In my experience, an array of pointers to lines is a very efficient choice,
You get O(1) access to any point in the buffer (provided you use <line,column>
as coordinates), and in typical code sources lines are reasonably small so
that using a single char array for lines is fast enough.

Its easy to understand, implement and has excellent performances on non
patholical text text.

From my experience with Kakoune, you almost never need the byte-offset of a
character, but very often the line,column pair. So using these as basic
coordinates (and implementing the buffer backend in consequence) makes
much sense.
Received on Thu Jul 10 2014 - 22:21:43 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 10 2014 - 22:24:07 CEST