all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Gap buffer problem?
@ 2024-12-12 23:40 arthur miller
  2024-12-13  3:19 ` Gerd Möllmann
  0 siblings, 1 reply; 148+ messages in thread
From: arthur miller @ 2024-12-12 23:40 UTC (permalink / raw)
  To: gerd.moellmann@gmail.com; +Cc: emacs-devel@gnu.org

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

>>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>>> Cc: emacs-devel@gnu.org,  ofv@wanadoo.es,  pipcet@protonmail.com
>>> Date: Wed, 11 Dec 2024 16:51:56 +0100
>>>
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>
>>> > Unless you have a huge (and I mean a HUGE) buffer, and some Lisp that
>>> > moves point, then inserts a small number of characters, then moves
>>> > point far away and again inserts a small number of characters, etc.,
>>> > I'd be very surprised if the gap buffer caused significant performance
>>> > problems on a modern CPU.
>>> >
>>> > Can you profile that case and post the expanded profile?  I'm always
>>> > happy to be wrong about performance bottlenecks, and profiles are good
>>> > at proving me wrong.
>>>
>>> Maybe I'll try to investigate that further at some point. Such things
>>> always tend to be so time consuming...
>>
>> I meant profiling with "M-x profile-start", then run your slow-down
>> recipe.  That should be easy and should not consume any significant
>> time.  Analyzing the profile could, but producing it shouldn't.
>
>Plus making it reproducible, if it is.

There is a paper by R. Strandh & others from they work on Climacs.

They have, by now a 20 old year Flexichain implements a circular gap
buffer with the explicit goal to workaround that case. At the same time
it also turns gap buffer into a flexible array usable for other use-cases
like qeues and stacks.

However, they have also gone away from the gap buffer, to something they
call "Cluffer", and which is a strategy where they use a double
linked list of lines. The "open" line is a gap buffer. As they say
in the introduction, the similiar strategy was used in Multics Emacs.
The idea is to allow for incremental editing, a lá
tree sitter I guess, and it is also suitable for multiple cursors. They
also say that for modern hardware the additional memory cost of double
linked lists is not prohibitive.

For those interested relevant papers and sources are here:

https://flexichain.common-lisp.dev/download/StrandhVilleneuveMoore.pdf
https://www.european-lisp-workshop.org/archives/2004/slides/Strandh-slides.pdf
https://github.com/robert-strandh/Flexichain

http://metamodular.com/cluffer.pdf
https://hal.science/hal-01887230v1/file/5-incremental-parsing.pdf
https://research.gold.ac.uk/id/eprint/2351/1/climacssyntax.pdf
https://github.com/robert-strandh/Cluffer

https://github.com/scymtym/text.editing <-- a text editor sans the
application based on the Cluffer

https://github.com/robert-strandh/Second-Climacs <-- text editor
application based on the above text.editing and Cluffer

There is also Lem which uses a similar strategy for its text representation
(if I am not misstaken, long time ago I looked at their code):

https://github.com/lem-project/lem
[https://opengraph.githubassets.com/936483c1586b682884e2dfee10ced041f6306d29afd3df15a26830cc9eb47f65/lem-project/lem]<https://github.com/lem-project/lem>
GitHub
 - lem-project/lem: Common Lisp editor/IDE with high expansibility<https://github.com/lem-project/lem>
Common
 Lisp editor/IDE with high expansibility. Contribute to lem-project/lem development by creating an account on GitHub.
github.com


Don't know if it is of use for you or not, but perhaps there is some
inspiration there. Haven't seen those papers mentioned anywhere
in this discussion, so thought they might be of interest to some of you.

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

^ permalink raw reply	[flat|nested] 148+ messages in thread

end of thread, other threads:[~2024-12-20  9:27 UTC | newest]

Thread overview: 148+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.39.1723910423.12184.emacs-devel@gnu.org>
2024-08-17 22:49 ` Emacs-devel Digest, Vol 246, Issue 17 ali_gnu2
2024-08-18  0:10   ` Po Lu
2024-08-18  0:19     ` Po Lu
2024-08-18  1:15     ` Solaris dldump (was: Pure space) ali_gnu2
2024-08-18  1:25       ` Solaris dldump Po Lu
2024-08-18 22:27         ` Stefan Kangas
2024-08-18 23:56           ` Po Lu
2024-08-19 11:18             ` Eli Zaretskii
2024-08-19 12:09               ` Po Lu
2024-08-19 12:50                 ` Eli Zaretskii
2024-08-19 11:44             ` Pip Cet
2024-08-19 11:57               ` Po Lu
2024-08-19 12:10                 ` Pip Cet
2024-08-19 12:55                   ` Eli Zaretskii
2024-08-19 13:46                     ` Pip Cet
2024-08-19 14:39                       ` Eli Zaretskii
2024-08-19 15:26                         ` Corwin Brust
2024-08-19 15:31                           ` Corwin Brust
2024-08-19 20:51                       ` Stefan Kangas
2024-08-19 20:35             ` Stefan Kangas
2024-12-08 12:17     ` pdumper on Solaris 10 Pip Cet via Emacs development discussions.
2024-12-08 13:05       ` Eli Zaretskii
2024-12-08 13:52         ` Pip Cet via Emacs development discussions.
2024-12-08 14:52           ` Eli Zaretskii
2024-12-08 16:17             ` Pip Cet via Emacs development discussions.
2024-12-08 16:49               ` Eli Zaretskii
2024-12-08 17:37                 ` Pip Cet via Emacs development discussions.
2024-12-08 18:41                   ` Eli Zaretskii
2024-12-08 19:15                     ` Gerd Möllmann
2024-12-08 20:38                       ` Eli Zaretskii
2024-12-09  3:09                         ` Gerd Möllmann
2024-12-09  3:32                           ` Eli Zaretskii
2024-12-09  3:43                             ` Gerd Möllmann
2024-12-09  4:53                               ` Stefan Kangas
2024-12-09  5:26                                 ` Gerd Möllmann
2024-12-09 13:58                                 ` Eli Zaretskii
2024-12-10  0:02                                   ` Po Lu
2024-12-09  9:56                           ` Pip Cet via Emacs development discussions.
2024-12-10  0:04                             ` Po Lu
2024-12-10  3:34                               ` Eli Zaretskii
2024-12-11  1:13                                 ` Po Lu
2024-12-11 11:29                                   ` Pip Cet via Emacs development discussions.
2024-12-09  4:59                     ` Stefan Kangas
2024-12-09 14:39                       ` Eli Zaretskii
2024-12-09 21:06                         ` Merging MPS a.k.a. scratch/igc, yet again Stefan Kangas
2024-12-09 21:49                           ` Óscar Fuentes
2024-12-10  4:17                             ` Xiyue Deng
2024-12-10  4:26                               ` Sean Whitton
2024-12-10  4:42                               ` chad
2024-12-10 13:10                               ` Óscar Fuentes
2024-12-10 15:10                                 ` Pip Cet via Emacs development discussions.
2024-12-10 15:37                                   ` Óscar Fuentes
2024-12-10 15:47                                     ` Pip Cet via Emacs development discussions.
2024-12-10 17:16                                     ` Eli Zaretskii
2024-12-12  4:37                                   ` Xiyue Deng
2024-12-19 16:02                                   ` Gregor Zattler
2024-12-19 17:32                                     ` Pip Cet via Emacs development discussions.
2024-12-19 18:12                                       ` Gerd Möllmann
2024-12-19 18:27                                         ` Eli Zaretskii
2024-12-19 18:39                                           ` Gerd Möllmann
2024-12-19 19:15                                         ` Pip Cet via Emacs development discussions.
2024-12-19 19:57                                           ` Gerd Möllmann
2024-12-20  6:39                                             ` Eli Zaretskii
2024-12-20  9:27                                       ` Gregor Zattler
2024-12-10 13:20                               ` Eli Zaretskii
2024-12-10 14:46                               ` Pip Cet via Emacs development discussions.
2024-12-10 13:09                             ` Eli Zaretskii
2024-12-10 13:20                               ` Óscar Fuentes
2024-12-10 14:41                                 ` Eli Zaretskii
2024-12-09 23:13                           ` chad
2024-12-10 12:41                           ` Eli Zaretskii
2024-12-10  0:09                         ` pdumper on Solaris 10 Stefan Kangas
2024-12-10 12:59                           ` Eli Zaretskii
2024-12-10 13:39                             ` Óscar Fuentes
2024-12-10 14:39                               ` Eli Zaretskii
2024-12-10 15:21                                 ` Óscar Fuentes
2024-12-10 16:39                                   ` Eli Zaretskii
2024-12-10 15:38                               ` Pip Cet via Emacs development discussions.
2024-12-10 16:04                                 ` Óscar Fuentes
2024-12-10 17:23                                   ` Eli Zaretskii
2024-12-11  5:27                                 ` Gap buffer problem? Gerd Möllmann
2024-12-11  8:50                                   ` Pip Cet via Emacs development discussions.
2024-12-11  9:35                                     ` Gerd Möllmann
2024-12-11 11:50                                       ` Pip Cet via Emacs development discussions.
2024-12-11 13:22                                         ` Gerd Möllmann
2024-12-11 14:53                                           ` Pip Cet via Emacs development discussions.
2024-12-11 15:33                                             ` Gerd Möllmann
2024-12-11 16:58                                               ` Eli Zaretskii
2024-12-11 17:13                                                 ` Gerd Möllmann
2024-12-11 17:45                                                   ` Robert Pluim
2024-12-11 18:11                                                     ` Gerd Möllmann
2024-12-11 19:08                                                     ` Eli Zaretskii
2024-12-11 17:41                                                 ` Pip Cet via Emacs development discussions.
2024-12-11 19:04                                                   ` Eli Zaretskii
2024-12-11 19:54                                                     ` Pip Cet via Emacs development discussions.
2024-12-11 20:26                                                       ` Eli Zaretskii
2024-12-11 22:07                                                       ` Dmitry Gutov
2024-12-11 19:09                                                   ` Gerd Möllmann
2024-12-12  8:55                                                     ` Robert Pluim
2024-12-12 10:14                                                       ` Gerd Möllmann
2024-12-11 12:27                                       ` Pip Cet via Emacs development discussions.
2024-12-11 13:27                                         ` Gerd Möllmann
2024-12-11 15:06                                           ` Marcus Harnisch
2024-12-11 22:11                                             ` Dmitry Gutov
2024-12-12  3:49                                               ` Gerd Möllmann
2024-12-12 19:07                                                 ` Dmitry Gutov
2024-12-12 19:30                                                   ` Eli Zaretskii
2024-12-12 19:40                                                   ` Gerd Möllmann
2024-12-12  6:01                                               ` Eli Zaretskii
2024-12-11 14:22                                   ` Eli Zaretskii
2024-12-11 15:51                                     ` Gerd Möllmann
2024-12-11 17:06                                       ` Eli Zaretskii
2024-12-11 17:15                                         ` Gerd Möllmann
2024-12-10 18:13                               ` pdumper on Solaris 10 Gerd Möllmann
2024-12-10 15:23                             ` Pip Cet via Emacs development discussions.
2024-12-10 17:08                               ` Eli Zaretskii
2024-12-10 18:03                                 ` Gerd Möllmann
2024-12-10 19:34                                   ` Pip Cet via Emacs development discussions.
2024-12-10 19:59                                     ` Gerd Möllmann
2024-12-10 20:17                                       ` Pip Cet via Emacs development discussions.
2024-12-10 20:34                                         ` Gerd Möllmann
2024-12-11 14:13                                   ` Pip Cet via Emacs development discussions.
2024-12-11 17:43                                     ` Eli Zaretskii
2024-12-14 14:30                                     ` Eli Zaretskii
2024-12-15 10:55                                       ` Pip Cet via Emacs development discussions.
2024-12-15 11:13                                         ` Eli Zaretskii
2024-12-15 12:09                                           ` Pip Cet via Emacs development discussions.
2024-12-15 12:52                                             ` Eli Zaretskii
2024-12-15 19:54                                             ` John ff
2024-12-17 19:10                                           ` Paul Eggert
2024-12-17 19:43                                             ` Pip Cet via Emacs development discussions.
2024-12-17 20:00                                               ` Paul Eggert
2024-12-17 20:19                                             ` Eli Zaretskii
2024-12-17 21:14                                               ` Paul Eggert
2024-12-09 16:21                       ` Pip Cet via Emacs development discussions.
2024-12-17 13:12                     ` Pip Cet via Emacs development discussions.
2024-12-17 14:16                       ` Eli Zaretskii
2024-12-18  0:55                       ` Po Lu
2024-12-18  9:24                         ` Pip Cet via Emacs development discussions.
2024-12-08 18:47                 ` Pip Cet via Emacs development discussions.
2024-12-09  1:13                 ` Po Lu
2024-12-09  1:08           ` Po Lu
2024-12-09  0:58       ` Po Lu
2024-12-09  3:28         ` Eli Zaretskii
2024-12-09  1:01       ` Po Lu
2024-12-09 13:11         ` Pip Cet via Emacs development discussions.
2024-12-12 23:40 Gap buffer problem? arthur miller
2024-12-13  3:19 ` Gerd Möllmann

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.