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: Scrolling xdisp.c. Room for optimisation in syntax.c/CC Mode. Date: Mon, 20 Oct 2014 11:47:27 +0000 Message-ID: <20141020114727.GB2947@acm.acm> References: <20141018181937.GA5924@acm.acm> <20141018202839.GB5924@acm.acm> <5444B9EF.4050506@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" X-Trace: ger.gmane.org 1413805732 12596 80.91.229.3 (20 Oct 2014 11:48:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2014 11:48:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 20 13:48:45 2014 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 1XgBS0-0003Ap-Mi for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2014 13:48:36 +0200 Original-Received: from localhost ([::1]:44126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgBS0-0001vY-Ag for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2014 07:48:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgBRn-0001kX-TX for emacs-devel@gnu.org; Mon, 20 Oct 2014 07:48:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgBRg-0004Lr-Ef for emacs-devel@gnu.org; Mon, 20 Oct 2014 07:48:23 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:65322 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgBRg-0004LX-4x for emacs-devel@gnu.org; Mon, 20 Oct 2014 07:48:16 -0400 Original-Received: (qmail 27577 invoked by uid 3782); 20 Oct 2014 11:48:14 -0000 Original-Received: from acm.muc.de (pD951B873.dip0.t-ipconnect.de [217.81.184.115]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 20 Oct 2014 13:48:13 +0200 Original-Received: (qmail 3271 invoked by uid 1000); 20 Oct 2014 11:47:27 -0000 Content-Disposition: inline In-Reply-To: <5444B9EF.4050506@gmx.at> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:175585 Archived-At: --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Martin. On Mon, Oct 20, 2014 at 09:29:51AM +0200, martin rudalics wrote: > Results for Windows XP with CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' > --enable-checking=yes --enable-check-lisp-object-type=yes: > Unmodified xdisp.c from trunk: > 24.3 1007 scrolls, total time = 105.60900020599365s. > 24.4 1007 scrolls, total time = 73.21900010108948s. > 25.0 1007 scrolls, total time = 318.5629997253418s. > xdisp.c from trunk with odd apostrophes eradicated: > 24.3 1007 scrolls, total time = 100.1240005493164s. > 24.4 1007 scrolls, total time = 60.13900017738342s. > 25.0 1007 scrolls, total time = 197.95300006866455s. > I can't test with older versions since those don't have > `scroll-down-command' here. Just replace it with `scroll-down'. > So while it might be worthwhile to do such an optimization, here the > great differenece is the 3-to-5-fold increase of execution time from > 24.4 to 25.0 for which I don't have an explanation. The cc-mode used is > always the one bundled with the respective Emacs version. I got this, until I re-bootstrapped my trunk with full compiler optimisation, no debugging set, and no extra checks enabled. Then I got pretty much the same results for the trunk as 24.4. The main reason I did all this, which nobody's commented on so far, was to get a handle on how much the `open-paren-in-column-0-is-defun-start', now bound to nil at critical places in CC Mode, was actually costing on a large C file. On 24.4 you get 22%, on the trunk, 61%. I get 31% in 24.4, and 32% in the trunk. It seems that "instrumentation" is increasing the cost of open-paren-etc. > martin > BTW, if you want to quickly visualize constructs like > (defconst odd-apostrophes > "/\\*\\([^*']\\|\\*+[^*'/]\\)*\\(\\**'\\([^*']\\|\\*+[^*'/]\\)*\\**'\\([^*']\\|\\*+[^*'/]\\)*\\)*\\**\\('\\)\\([^*']\\|\\*+[^*'/]\\)*\\*+/" > ) > without adding comments like > ;; 1 2 3 4 5 6 > you can use the regexp-lock.el package I attached here ;-) Neat! What I actually use is a little tool I wrote called pp-regexp. Given a string, it dumps a readable representation of the regexp into *scratch*, something like: /\*\( \| \)*\( \)*\**\( \)\( \| \)*\*+/ [^*'] \*+[^*'/] \**'\( \| \)*\**'\( \| \)* ' [^*'] \*+[^*'/] [^*'] \*+[^*'/] [^*'] \*+[^*'/] See attached file. -- Alan Mackenzie (Nuremberg, Germany). --Qxx1br4bt0+wmkIi Content-Type: application/octet-stream Content-Disposition: attachment; filename="pp-regexp.el.gz" Content-Transfer-Encoding: base64 H4sICIN3Pk4AA3BwLXJlZ2V4cC5lbACdVk1v20YQPUu/YsBLlqlpRElRA5FTIQjSNjcjzaFA 2cOKGklEqCW7XEUW4H/jgy/+c/4HfbO7/JDt9BAB+pqdmX3z3sxIasXrvSFntWkr7TizxpGy vOHrJp0SJZ8//v7xrysqW9LUOluazTnRl86dtDlS7ig3lFt8WVG+pmKrrS4c23bqajqUbFdk apO9//PDp0/UIIfTy4pHfm8lB3zvSc0uXp9R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