From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Tobias C. Rittweiler" Newsgroups: gmane.emacs.devel Subject: Re: Low redisplay performance (23 regression) Date: Thu, 30 Apr 2009 09:34:44 +0200 Message-ID: <878wliy4q3.fsf@freebits.de> References: <4870CC42-A08E-4BE9-B566-0F4DA7AB0B74@gmail.com> <878wlj228q.fsf@freebits.de> <87skjrz7k7.fsf@freebits.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241076938 14554 80.91.229.12 (30 Apr 2009 07:35:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2009 07:35:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 30 09:35:28 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LzQnn-0008UC-VH for ged-emacs-devel@m.gmane.org; Thu, 30 Apr 2009 09:35:28 +0200 Original-Received: from localhost ([127.0.0.1]:37848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzQnn-0008Bd-DF for ged-emacs-devel@m.gmane.org; Thu, 30 Apr 2009 03:35:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzQnR-0007w5-D1 for emacs-devel@gnu.org; Thu, 30 Apr 2009 03:35:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzQnL-0007rk-UU for emacs-devel@gnu.org; Thu, 30 Apr 2009 03:35:04 -0400 Original-Received: from [199.232.76.173] (port=46361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzQnL-0007rV-Nl for emacs-devel@gnu.org; Thu, 30 Apr 2009 03:34:59 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:42510) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LzQnL-0007kO-4V for emacs-devel@gnu.org; Thu, 30 Apr 2009 03:34:59 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzQnJ-0003kX-7X for emacs-devel@gnu.org; Thu, 30 Apr 2009 03:34:57 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LzQnG-0004y8-80 for emacs-devel@gnu.org; Thu, 30 Apr 2009 07:34:54 +0000 Original-Received: from host145.natpool.mwn.de ([138.246.7.145]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Apr 2009 07:34:54 +0000 Original-Received: from tcr by host145.natpool.mwn.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Apr 2009 07:34:54 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 152 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host145.natpool.mwn.de User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:60ckOuP9rNYdWRERWrUjN8Oay/0= X-detected-kernel: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:110569 Archived-At: Stefan Monnier writes: > > I'm not sure how much you can do with this information. But I can concur > > with the OP that there does seem to be a performance regression. > > Indeed font-lock-fontify-keywords-region (which is the part which I'd > expect to take the bulk of the time and would be a source of performance > problems no matter how you implement your > font-lock-extend-region-functions if you force refontification of the > whole defun every time), so as I was saying > font-lock-fontify-keywords-region got about twice as slow. And I can't > explain it. As far as I know, this part of font-lock has not been > changed in any significant way. What happens if you use Emacs-22's > font-lock.el in Emacs-23? Ok, see the profiling data below. I think I did everything the very same as yesterday. The first output shows the case where I linked the font-core.elc and font-lock.elc to the .elc files of 22.1. Surprisingly that worked. :-) You'll see that the first output shows a few less calls to END-OF-DEFUN, and BEGINNING-OF-DEFUN(-RAW) than yesterday's data. And is a bit faster on the whole. The second output shows the case where I compiled the font-*.el sources of 22.1 with a 23.x (by visiting the file, then issuing M-x byte-compile-file.) The second case seems to slow down everything a little bit. Although I wouldn't vouch for the results as they're only based on 1 sample. But has there been work on the byte-compiler? -T. PS. GNU Emacs 23.0.92.1 with font-core.elc, font-lock.elc symlinked to 22.1. jit-lock-function 478 7.9711269999 0.0166759979 jit-lock-fontify-now 478 7.9669629999 0.0166672866 font-lock-fontify-region 478 7.9076759999 0.0165432552 font-lock-default-fontify-region 478 7.8998459999 0.0165268744 font-lock-fontify-keywords-region 478 3.9014010000 0.0081619267 slime-extend-region-for-font-lock 953 3.2538709999 0.0034143452 slime-region-for-tlf-at-point 922 2.3568059999 0.0025561887 end-of-defun 1844 2.1011199999 0.0011394360 slime-region-for-extended-tlf-at-point 461 1.4019959999 0.0030412060 slime-search-suppressed-forms 922 1.2786319999 0.0013868026 font-lock-fontify-syntactically-region 478 0.6769720000 0.0014162594 beginning-of-defun-raw 4226 0.4991790000 0.0001181209 beginning-of-defun 2380 0.3932019999 0.0001652109 slime-forward-sexp 220 0.0930310000 0.0004228681 slime-forward-cruft 220 0.0895650000 0.0004071136 slime-post-command-hook 111 0.0680430000 0.0006130000 slime-eval-feature-conditional 444 0.0463489999 0.0001043896 slime-forward-reader-conditional 220 0.0386519999 0.0001756909 slime-lisp-features 444 0.0383999999 8.648...e-05 slime-forward-any-comment 220 0.0322529999 0.0001466045 font-lock-unfontify-region 478 0.0264229999 5.527...e-05 font-lock-default-unfontify-region 478 0.0187470000 3.921...e-05 slime-forward-blanks 220 0.014927 6.785e-05 slime-connection 444 0.0045750000 1.030...e-05 slime-pre-command-hook 111 0.0045430000 4.092...e-05 font-lock-extend-region-multiline 953 0.0034319999 3.601...e-06 font-lock-extend-region-wholelines 953 0.0032449999 3.405...e-06 slime-connected-p 922 0.0029949999 3.248...e-06 slime-keywordify 444 0.0027099999 6.103...e-06 font-lock-set-defaults 484 0.0015600000 3.223...e-06 jit-lock-context-fontify 9 0.0014320000 0.0001591111 slime-current-connection 444 0.0008870000 1.997...e-06 font-lock-mode 14 0.000837 5.978...e-05 font-lock-default-function 14 0.000567 4.05e-05 font-lock-mode-internal 2 0.00046 0.00023 font-lock-compile-keywords 2 0.000273 0.0001365 font-lock-turn-on-thing-lock 2 0.0001599999 7.999...e-05 jit-lock-register 2 0.0001040000 5.200...e-05 font-lock-compile-keyword 32 9.200...e-05 2.875...e-06 slime-lisp-mode-hook 1 8.9e-05 8.9e-05 slime-mode 1 7.9e-05 7.9e-05 jit-lock-mode 2 7.6e-05 3.8e-05 slime-setup-command-hooks 1 4.6e-05 4.6e-05 font-lock-add-keywords 2 4.6e-05 2.3e-05 jit-lock-refontify 2 4.200...e-05 2.100...e-05 slime-add-local-hook 2 3.4e-05 1.7e-05 font-lock-change-mode 1 2.6e-05 2.6e-05 font-lock-remove-keywords 2 2.2e-05 1.1e-05 font-lock-value-in-major-mode 5 1.2e-05 2.4e-06 font-lock-eval-keywords 2 9e-06 4.5e-06 slime-setup-first-change-hook 1 5e-06 5e-06 slime-add-easy-menu 1 4e-06 4e-06 font-lock-choose-keywords 1 4e-06 4e-06 ------------------------------------------------------------------------------ GNU Emacs 23.0.92.1 with font-core.elc, font-lock.elc byte-compiled from 22.1 sources. jit-lock-function 478 8.6693530000 0.0181367217 jit-lock-fontify-now 478 8.6651570000 0.0181279435 font-lock-fontify-region 478 8.6414769999 0.0180784037 font-lock-default-fontify-region 478 8.6329149999 0.0180604916 font-lock-fontify-keywords-region 478 4.1605249999 0.0087040271 slime-extend-region-for-font-lock 953 3.4857529999 0.0036576631 slime-region-for-tlf-at-point 922 2.5261709999 0.0027398817 end-of-defun 1844 2.2046559999 0.0011955835 slime-region-for-extended-tlf-at-point 461 1.411911 0.0030627136 slime-search-suppressed-forms 922 1.3772869999 0.0014938036 font-lock-fontify-syntactically-region 478 0.9161559999 0.0019166443 beginning-of-defun-raw 4226 0.4427990000 0.0001047796 beginning-of-defun 2380 0.4161659999 0.0001748596 slime-forward-sexp 220 0.1129909999 0.0005135954 slime-forward-cruft 220 0.1092269999 0.0004964863 slime-eval-feature-conditional 444 0.0950729999 0.0002141283 slime-forward-any-comment 220 0.086004 0.0003909272 slime-lisp-features 444 0.0853749999 0.0001922860 font-lock-unfontify-region 478 0.0296069999 6.193...e-05 font-lock-default-unfontify-region 478 0.0228370000 4.777...e-05 slime-forward-blanks 220 0.0164640000 7.483...e-05 slime-connection 444 0.0050060000 1.127...e-05 slime-pre-command-hook 106 0.004678 4.413...e-05 font-lock-extend-region-wholelines 953 0.0036529999 3.833...e-06 font-lock-extend-region-multiline 953 0.0036179999 3.796...e-06 jit-lock-context-fontify 19 0.002982 0.0001569473 slime-keywordify 444 0.0028969999 6.524...e-06 slime-connected-p 922 0.0022989999 2.493...e-06 font-lock-set-defaults 484 0.0016010000 3.307...e-06 slime-forward-reader-conditional 220 0.0010569999 4.804...e-06 font-lock-mode 17 0.0010459999 6.152...e-05 slime-current-connection 444 0.0009930000 2.236...e-06 font-lock-default-function 17 0.000617 3.629...e-05 slime-post-command-hook 106 0.0006169999 5.820...e-06 font-lock-mode-internal 2 0.0004450000 0.0002225000 font-lock-compile-keywords 2 0.0001880000 9.400...e-05 font-lock-turn-on-thing-lock 2 0.000158 7.9e-05 font-lock-change-mode 2 0.00011 5.5e-05 jit-lock-register 2 0.000102 5.1e-05 slime-lisp-mode-hook 1 9e-05 9e-05 slime-mode 1 8e-05 8e-05 jit-lock-mode 2 7.500...e-05 3.750...e-05 font-lock-compile-keyword 32 6.400...e-05 2.000...e-06 font-lock-add-keywords 2 4.8e-05 2.4e-05 slime-setup-command-hooks 1 4.7e-05 4.7e-05 jit-lock-refontify 2 4.1e-05 2.05e-05 slime-add-local-hook 2 3.4e-05 1.7e-05 font-lock-remove-keywords 2 2.2e-05 1.1e-05 font-lock-value-in-major-mode 5 1.2e-05 2.4e-06 font-lock-eval-keywords 2 9e-06 4.5e-06 slime-setup-first-change-hook 1 5e-06 5e-06 slime-add-easy-menu 1 4e-06 4e-06 font-lock-choose-keywords 1 4e-06 4e-06