From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: outline/allout/overlay performance Date: Wed, 11 Jan 2006 17:50:22 -0500 Message-ID: References: <2cd46e7f0601091127w7f988942w33a105481ccd02e0@mail.gmail.com> <2cd46e7f0601110821x5c97c63bj25d80df70240c80e@mail.gmail.com> <2cd46e7f0601111223m4e568b56n283d038ccfff6be0@mail.gmail.com> <2cd46e7f0601111400j452ee7dexfc79b643ee3655d0@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137019860 21355 80.91.229.2 (11 Jan 2006 22:51:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2006 22:51:00 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 23:50:56 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ewong-0006Dr-70 for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2006 23:50:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ewopj-0003s4-FR for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2006 17:52:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ewopb-0003ry-1K for emacs-devel@gnu.org; Wed, 11 Jan 2006 17:52:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EwopW-0003rm-Gh for emacs-devel@gnu.org; Wed, 11 Jan 2006 17:52:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EwopW-0003rj-Dm for emacs-devel@gnu.org; Wed, 11 Jan 2006 17:52:34 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EwosD-0008Nz-Vd for emacs-devel@gnu.org; Wed, 11 Jan 2006 17:55:22 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id F29EC33E601; Wed, 11 Jan 2006 17:50:25 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id B70634AC00F; Wed, 11 Jan 2006 17:50:22 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 95182E6A42; Wed, 11 Jan 2006 17:50:22 -0500 (EST) Original-To: Ken Manheimer In-Reply-To: <2cd46e7f0601111400j452ee7dexfc79b643ee3655d0@mail.gmail.com> (Ken Manheimer's message of "Wed, 11 Jan 2006 17:00:46 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.854, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48943 Archived-At: >> > i think i've surmounted the performance problem i was seeing, by >> > better stitching together the overlays. >> Good news. > but maybe premature - the behaviour "came back". i will have to > carefully implement the stitching together stuff before coming to a > conclusion about viability. >> [...] >> > these choices are hard-coded in the current `outline-flag-region', so >> > i can't use it as stands. i could suggest a slightly modified version >> > which open-codes these choices so "derivative" outline modes can use it >> > directly while tailoring these aspects for their specific purposes. does >> > that seem like a reasonable way to go? >> >> I don't understand why outline-flag-region should have anything to do with >> the implementation of an isearch-open-invisible(-temporary) function, so I'm >> probably not understanding you well, but improving outline-flag-region so it > the function is registered with the overlay, as a property - that's > why the current outline-flag-region sets it. i want to make the > function it registers with the overlay parameterized - eg, a mode > local variable - to be registered if set. outline-mode's current one > (`outline-isearch-open-invisible') will be used for outline-mode, and > allout will have its own. other modes could, too. Actually, some other modes using similar functions add a few more properties, so I think it makes sense to just add a &rest parameter to outline-flag-region. As for using a buffer-local variable for outline-isearch-open-invisible, it assumes only one major/minor mode will use it at a time. In reveal.el I chose to allow a reveal-toggle-invisible property on the overlay or on the symbol used for invisibility. So in outline.el rather than adding the property to every single overlay, I just do (put 'outline 'reveal-toggle-invisible 'outline-reveal-toggle-invisible) and reveal.el finds it with (get (overlay-get ol 'invisible) 'reveal-toggle-invisible) Maybe isearch (c|sh)ould be changed in a similar way. >> stitches overlays together sounds like a good idea. >> Maybe it could be made into a generic function, much like remove-overlays >> and moved to subr.el. > i'll take a look at remove-overlays, when i get to that point. All I was thinking is to add a function like (add-overlay-props FROM TO &rest PROPS) which either creates a new overlay with the specified props or moves existing overlays if there's already an overlay around with the right properties, thus trying to minimize the number of overlays in the buffer. This said, it's probably more important to work on the C code to try and remove the O(n) behavior. And even if it's not removed everywhere, I can't think of any reason why cursor movement should suffer from this O(n) behavior. Stefan