emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `make-overlay' very slow


From: Stefan Monnier
Subject: Re: `make-overlay' very slow
Date: Fri, 10 Apr 2009 19:36:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

> and I found out that it is, alas, unusable.  It starts with about 1000
> replacements per second on my GNU/Linux box (using simply `-' as the
> regexp), but soon the speed decreases: After approx. 10000
> replacements it only can handle 100 replacements per second -- the
> attached code now contains a small counter to show the progress.  If
> you comment out the call to `make-overlay', the code really flies...

> Am I doing something wrong?

overlays have a poor algorithmic behavior (many operations take a time
proportional to the number of overlays in the buffer).  Better use
text-properties (which are implemented with a tree and should provide
something closer to O(log N) complexity instead).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]