GNU bug report logs -
#26051
25.1; overlays may make emacs very slow
Previous Next
Reported by: ynyaaa <at> gmail.com
Date: Fri, 10 Mar 2017 16:26:02 UTC
Severity: minor
Merged with 2963
Found in version 25.1
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 26051 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> My guess is because we need to compute the byte position of the
> markers that store the overlay's beginning and end. But that's just a
> guess.
I tested with markers.
Markers make emacs slow too(a little bit faster than overlays).
M-x occur may make a buffer have thousands of markers,
and make point motion commands slow.
(benchmark
1
'(with-temp-buffer
(let ((n 65536))
(save-excursion (dotimes (i n) (insert (format "\u00E1%d\n" i))))
(dotimes (i n) (make-overlay (point) (point)) (forward-line)))))
=>"Elapsed time: 129.815000s (0.277000s in 17 GCs)"
(benchmark
1
'(with-temp-buffer
(let ((n 65536) tmp)
(save-excursion (dotimes (i n) (insert (format "\u00E1%d\n" i))))
(dotimes (i n)
;; protect against garbage collection
(setq tmp (cons (list (point-marker) (point-marker)) tmp))
(forward-line)))))
=>"Elapsed time: 90.038000s (0.272000s in 16 GCs)"
> Btw, your original recipe will produce a much faster redisplay if you
> set bidi-paragraph-direction of the buffer to left-to-right, instead
> of leaving it at its default nil value. Sorry I didn't mention this
> earlier.
It is a good solution for me, thanks.
This bug report was last modified 1 year and 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.