From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Sun, 4 Dec 2016 15:22:48 +0000 Message-ID: <20161204152247.GD2791@acm.fritz.box> References: <83zikdl7oo.fsf@gnu.org> <83y3zxkwms.fsf@gnu.org> <20161203143603.GA6921@acm.fritz.box> <43e8a279-3278-817b-7cd4-b669c5ae320b@yandex.ru> <20161204123434.GB2791@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1480865059 2671 195.159.176.226 (4 Dec 2016 15:24:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Dec 2016 15:24:19 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 04 16:24:15 2016 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 1cDYeD-0007q0-MR for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2016 16:24:13 +0100 Original-Received: from localhost ([::1]:34792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDYeE-0003xy-1L for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2016 10:24:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDYdI-0003x0-7z for emacs-devel@gnu.org; Sun, 04 Dec 2016 10:23:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDYdF-0002Qt-3R for emacs-devel@gnu.org; Sun, 04 Dec 2016 10:23:16 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:25128 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1cDYdE-0002Qh-TB for emacs-devel@gnu.org; Sun, 04 Dec 2016 10:23:13 -0500 Original-Received: (qmail 22990 invoked by uid 3782); 4 Dec 2016 15:23:09 -0000 Original-Received: from acm.muc.de (p548C7677.dip0.t-ipconnect.de [84.140.118.119]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 04 Dec 2016 16:23:08 +0100 Original-Received: (qmail 22477 invoked by uid 1000); 4 Dec 2016 15:22:48 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 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:210021 Archived-At: Hello, Stefan. On Sun, Dec 04, 2016 at 09:08:26AM -0500, Stefan Monnier wrote: > > Your patch was indeed simpler. Indeed, it was so simple as actually not > > to work in general, as well as being ~2 orders of magnitude slower than > > the current (forward-comment -1). > You make it sound like it barely ever works and it's always 100 > times slower. I think this qualifies as "gross misrepresentation". I don't think it does. Your patch won't work, for example, if a lisp program sets syntax-table text properties (which is _always_ done when before/after-change-functions are disabled). This is a very important scenario. Consider (forward-comment -1) backwards over a 100 character comment. The current code will do this in 100n units of time, for some value of n. In your patch, we need to calculate the parse-partial-sexp state at the comment, and this is going to involve a parse-partial-sexp moving forward over, on average, 10,000 characters. This is going to take 10,000m units of time, for some m. 10,000m is two orders of magnitude larger than 100n. Now, I'm not saying your patch couldn't be improved to handle these and other things. Firstly, it then wouldn't be a "simple" patch any longer. And the next thing, why bother, when the comment-cache code already exists and works? > Stefan -- Alan Mackenzie (Nuremberg, Germany).