From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Overlays as an AA-tree Date: Mon, 06 Feb 2017 12:34:38 -0500 Message-ID: References: <87d1jylv43.fsf@fastmail.com> <87fujv64mn.fsf@hochschule-trier.de> <87fujvpkzc.fsf@fastmail.com> <87vasr5tqd.fsf@hochschule-trier.de> <87d1ex4kon.fsf@hochschule-trier.de> <87d1evod6x.fsf@fastmail.com> <877f53ftab.fsf@hochschule-trier.de> <878tpjnxkt.fsf@fastmail.com> <87zihzmfbv.fsf@fastmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486403555 11147 195.159.176.226 (6 Feb 2017 17:52:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 17:52:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 18:52:32 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1canSp-0002iI-SY for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 18:52:31 +0100 Original-Received: from localhost ([::1]:49940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1canSv-0002Lw-EL for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 12:52:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1canBl-0005Ft-4k for emacs-devel@gnu.org; Mon, 06 Feb 2017 12:34:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1canBi-0006qk-1I for emacs-devel@gnu.org; Mon, 06 Feb 2017 12:34:53 -0500 Original-Received: from [195.159.176.226] (port=46229 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1canBh-0006py-Qr for emacs-devel@gnu.org; Mon, 06 Feb 2017 12:34:49 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1canBY-0000hy-Kb for emacs-devel@gnu.org; Mon, 06 Feb 2017 18:34:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 18 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:8gvz3MEC4Ixo1fZI6Smls8GrwfI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212049 Archived-At: > True. Even rarer I guess that they have differing front-advance types. > Still I think finding those overlays, deleting them if they are there > and then reinserting them requires quite a few traversals of the tree. Should cost O(N * log M) where N is the number of overlays that you need to remove&add and N is the total number of overlays. IOW should be very fast. > Maybe it's not a big deal perfomance wise, but I have a feeling the code > could be a bit messy. (But my feelings are eusually not correct) My assumption is that the code to remove&add would be easy to write, but I've often been wrong in such assessments as well. All I'm saying is that remove&add should be plenty fast enough, so it should not be dismissed on performance grounds. But if another solution is simpler... Stefan