]> git.eshelyaron.com Git - emacs.git/commit
Speed up replace-buffer-contents
authorEli Zaretskii <eliz@gnu.org>
Fri, 29 Jun 2018 13:55:20 +0000 (16:55 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 29 Jun 2018 13:55:20 +0000 (16:55 +0300)
commiteec71ebdb50c3110bb747db57c7d7f04b6d14ad1
tree78f81836140a0b47e8875e86623c1a091291110e
parent93c41ce6aa64b14fc9bd7bdd0d909915a79191cd
Speed up replace-buffer-contents

* src/editfns.c (EXTRA_CONTEXT_FIELDS): Add a_unibyte and
b_unibyte members.
(rbc_quitcounter): New static variable.
(Freplace_buffer_contents): Initialize a_unibyte, b_unibyte, and
rbc_quitcounter.  Inhibit modification hooks if they were not
already inhibited.  Use rarely_quit to allow user to quit, to
avoid calling maybe_quit too frequently (which hurts performance).
Remove redundant assertions (which hurt performance too much).
Call signal_after_change and update_compositions after all the
changes are done.
(buffer_chars_equal): Remove redundant assertions (which hurt
performance).  Avoid using BUF_FETCH_CHAR_AS_MULTIBYTE, which
hurts performance by referencing Lisp symbols; instead, use
lower-level macros with explicit tests to select which macro to
use.  (Bug#31888)
src/editfns.c