From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Mon, 06 Apr 2020 19:41:49 -0400 Message-ID: References: <054393f3-3873-ab6e-b325-0eca354d8838@gmx.at> <20200403174757.GA8266@ACM> <20200405111623.GB5049@ACM> <20200406193633.GD7100@ACM> <29a94d23-c92e-ac66-2a19-64d7d1b86290@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="86301"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: rms@gnu.org, emacs-devel@gnu.org, rudalics@gmx.at, rrandresf@gmail.com, Alan Mackenzie , eliz@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 07 01:42:40 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLbO4-000MMZ-C6 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Apr 2020 01:42:40 +0200 Original-Received: from localhost ([::1]:39108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLbO3-0004zV-8G for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Apr 2020 19:42:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52772) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLbNN-0004R0-5M for emacs-devel@gnu.org; Mon, 06 Apr 2020 19:41:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLbNL-0004Z6-8p for emacs-devel@gnu.org; Mon, 06 Apr 2020 19:41:56 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42053) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLbNJ-0004Wc-He; Mon, 06 Apr 2020 19:41:53 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C5CBB44FD7C; Mon, 6 Apr 2020 19:41:52 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8D9FD44FD75; Mon, 6 Apr 2020 19:41:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1586216510; bh=vxEB3xLULivdt/3m4CNP5KFafIALeB09pJdRDPK8Qnk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jzbCc5VPzz0iyY/PKsvveSNY8r39q6U06ydk6rI0YX3GoWsvN1uTyNOorV90G92zg Rv7DLDI+i05DomH5GV59n2fh0y6gzi57kMabnwVkMrj5S+ZHl1a4l+bxqO/vdiXIbX xaHd3uWuRrtmRKLmCWSoUmpRlGeFmrUOK6JILIkcTcaLI9HnDph55XFGbEMUu/xDKU /+Lqn4F+euIX62RrCxk84lUi6eAazTZPuZLdyB5dJ82jhin3/lJBBSEnCeYB1r3V96 H+/dPGjo+c/sZY2jyDrsUQfdjNPCnqjfPakQgQI/te6PsxqbaVFf/MCD21urXVHKLt 0B6icxnuwHxgw== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 23D7A120432; Mon, 6 Apr 2020 19:41:50 -0400 (EDT) In-Reply-To: <29a94d23-c92e-ac66-2a19-64d7d1b86290@yandex.ru> (Dmitry Gutov's message of "Tue, 7 Apr 2020 01:12:37 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246573 Archived-At: > So you chose the absolute worst scenario for syntax-ppss, right? Where its > cache would be unavoidably clobbered at least once. I'm guessing the > difference between measurements is ~ how long (parse-partial-sexp > (point-min) (point-max)) takes on your machine in that file. FWIW, `syntax-ppss` has not been optimized for this case at all, so I wouldn't be surprised if it takes noticeably more than (parse-partial-sexp (point-min) (point-max)) because it performs that computation in chunks, and the overhead for each chunk is likely non-negligible. [ Note: this is just a wild guess on my part. I never bothered to measure it: `syntax-ppss` is a fairly naive implementation with a lot of room for improvement. ] IOW if it takes the same time as (parse-partial-sexp (point-min) (point-max)) then I'm quite happy ;-) > How about some other, more common scenarios? I agree that it's probably not very representative. >> Here are the results: >> open-paren-in-column-zero-is-defun-start >> nil t >> comment-use-syntax-ppss >> nil 0.319s 0.264s >> t 0.319s 0.227s >> . Bearing in mind that c-u-s-p being t suppresses the action of >> o-p-i-c-0-i-d-s in back_comment, but not in beginning-of-defun, it seems >> like the o-p-i-c-0-i-d-s mechanism does indeed speed up some scenarios >> in C Mode, significantly but not massively. >> IMAO, It would be nice to have the code testing o-p-i-c-0-i-d-s (both >> places) able to ignore spurious cases of parens in literals. The problem here is that in order to decide whether or not it's *still* spurious after the change near BOB, you basically have to compute the equivalent of `syntax-ppss`. So we're back to square one. What could be done is to change `syntax-ppss` so it optimizes for the case where the buffer changes do not impact the way parsing is done "further down" (i.e. not for the case where the change just opened (or closed) a string/comment). Not sure it's worth the trouble, OTOH. > 1 without certain text property applied. I'm not 100% sure why this var is > marked obsolete now (probably because it creates murky semantics), but this > is the simplest way to add this behavior, I think. Yes, the problem is the murky semantics (including the fact that you can't rely on it being used, even though some code does want to rely on it, typically in multi-mode setups where it's abused to impose a boundary). > In any case, I'm afraid all this won't bring any dramatic improvement in the > more usual scenarios which I mentioned above. And we'll be back to looking > for other ways to improve performance. That's also my impression. Stefan