Subject: Re: bug#49127: Performance degradation in encode_coding_object

From: Eli Zaretskii <[email-masked]>
Date: Tue, 17 Aug 2021 20:16:29 +0300

> From: Mattias Engdegård <[email-masked]>
> Date: Tue, 17 Aug 2021 18:07:10 +0200
> Cc: [email-masked], [email-masked]
> 
> This business makes me wonder if there are more cases where the linear marker list causes bad performance. Probably not very often but it's not unreasonable for a mode to have many data structures with many (live) markers into the text, and that would lead to text changes going from O(1) to O(text size). In any case, not anything to worry about right now.

It's a problem to have many markers in a buffer.  Not only for code
that searches them linearly, but also for stuff like converting
between character and byte positions, something that we do a lot in
the most inner loops of our code.  Lisp programs that produce gobs of
markers should be ideally redesigned not to do so.  Unless we change
the way we store markers to make that a non-issue.