From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Permission requested to merge branch comment-cache into master. Date: Sat, 12 Mar 2016 23:17:13 +0000 Message-ID: <20160312231713.GD10781@acm.fritz.box> References: <20160312002837.GJ2888@acm.fritz.box> <83mvq4gni4.fsf@gnu.org> <20160312100843.GA2572@acm.fritz.box> <83a8m4gd7p.fsf@gnu.org> <20160312115021.GB2572@acm.fritz.box> <837fh7ho78.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457824509 27305 80.91.229.3 (12 Mar 2016 23:15:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2016 23:15:09 +0000 (UTC) To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 13 00:14:55 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aeskI-0000FU-QC for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2016 00:14:55 +0100 Original-Received: from localhost ([::1]:33873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeskE-0003dg-LJ for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 18:14:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aesk2-0003dV-7J for emacs-devel@gnu.org; Sat, 12 Mar 2016 18:14:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aesjz-0000Qx-85 for emacs-devel@gnu.org; Sat, 12 Mar 2016 18:14:38 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:49572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aesjy-0000QT-VG for emacs-devel@gnu.org; Sat, 12 Mar 2016 18:14:35 -0500 Original-Received: (qmail 74523 invoked by uid 3782); 12 Mar 2016 23:14:33 -0000 Original-Received: from acm.muc.de (p548A446C.dip0.t-ipconnect.de [84.138.68.108]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 13 Mar 2016 00:14:32 +0100 Original-Received: (qmail 19259 invoked by uid 1000); 12 Mar 2016 23:17:13 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201569 Archived-At: Hello, John. On Sat, Mar 12, 2016 at 01:38:54PM -0800, John Wiegley wrote: > >>>>> Eli Zaretskii writes: > > Then I think this should go to the release branch. If there's a way to test > > it better on a branch, fine. Otherwise, let's include it in the next > > pretest, and let the crowd find any problems it could still have. > This change may be ready for 25.2 at a future date, but I don't believe it's > ready now. I would say it's not quite ready, but it's not far off. > Also, there is still enough debate around this feature from others, that I > prefer it to incubate on a feature branch at this time. That's where it is, on branch comment-cache. But it would be nicer to hear "actively test" than "incubate". ;-) > Especially, I'd like to see if there's a way to integrate your efforts > with Stefan's, rather than developing two separate systems to address > similar ideas. This is not possible, and the suggestion that it is is mischievous. The two approaches are fundamentally different. They aim to do different things, and they do them in very different ways. The comment-cache code is designed optimally to handle comments and strings and those things only, and to handle them at lightening speed. It is also written with simplicity and maintainability in mind. `syntax-ppss' is more general, handling general parse states, and does so with less speed. There is absolutely no reason why these two systems cannot exist at the same time. Indeed, they should. `syntax-ppss' is broken (see bug #22983): it does not do what its specification says, and what its specification says is unsuitable for use in the low level syntax routines. It is possible a similar function may be developed to take the place of `syntax-ppss' sometime in the future, but this will need development and testing, and around 200 calls to it in the Emacs sources will need checking and possibly adaptating. By contrast, the code in the comment-cache branch is ready now and, modulo minor bugs, is working. There has been no intimation from anybody that it doesn't work. It would be a shame for it to languish unused on a feature branch. You mentioned in another post that you were concerned about the speed of CC Mode. Well, I have prepared an emacs-25 build and a comment-cache build, strictly comparable, and timed Martin Rudalics's two functions `foo' and `bar' on xdisp.c. `foo' repeatedly calls `end-of-defun', `bar' repeatedly calls `beginning-of-defun'. Here are the timings: emacs-25 comment-cache increase in speed foo 2.590 1.662 56% bar 2.981 1.628 83% Thus on this (admittedly limited) test, comment-cache has delivered a massive speed boost to CC Mode, something I hadn't expected. There is more speed to be wrung out of the comment-cache mechanism - where now there is much scanning forward from "safe positions" (i.e. positions not in comments and strings), in comment-cache this could be rendered unnecessary, since the nearest safe position is no further away than a couple of text property lookups. By contrast, `syntax-ppss' works by keeping a list of positions 20,000 characters apart, and scanning forward from these position to produce the parse state at the desired position. This cannot compete speedwise with comment-cache. Where, then, do we go from here? Just how important is CC Mode's lack of performance? > Thanks, > -- > John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F > http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 -- Alan Mackenzie (Nuremberg, Germany).