Subject: bug#49127: Performance degradation in encode_coding_object

From: Mattias Engdegård <[email-masked]>
Date: Mon, 16 Aug 2021 20:06:32 +0200

16 aug. 2021 kl. 19.43 skrev Eli Zaretskii <[email-masked]>:

>> I don't know how this could ever work. We loop through the markers in the current buffer?
> 
> Yes.  Why do you think this loop is broken?

Because unless I misunderstood the code entirely, the current buffer has nothing to do with the operation at hand.

It's easy to reproduce the original problem: run Emacs in a terminal and make a buffer with many markers. See how the text displays slower with more markers. I've attached a short example; try (make-test-buffer 1000).

The attached patch fixes this problem.