unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20352: Factor 2 slow down of font-locking in c-mode
@ 2015-04-17  1:41 Stefan Monnier
       [not found] ` <mailman.852.1429234928.904.bug-gnu-emacs@gnu.org>
  2016-05-16 17:28 ` Paul Eggert
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2015-04-17  1:41 UTC (permalink / raw)
  To: 20352

Package: Emacs
Version: 25.0.50


   src/emacs -Q -nw src/xdisp.c 					 \
       --eval "(progn (font-lock-fontify-region (point-min) (point-max)) \
                      (kill-emacs))"

Is about twice as slow with the code from "master" as it is with the
code from the emacs-24 branch.


        Stefan




In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2015-04-14 on pastel
Repository revision: 12f00667ebea0fe4c1e173f9d15192c75471d9d3
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.0 (jessie)

Configured using:
 `configure -C --enable-checking --enable-check-lisp-object-type
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND GPM DBUS NOTIFY GNUTLS LIBXML2
FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LANG: fr_CH.UTF-8
  locale-coding-system: utf-8-unix

Major mode: InactiveMinibuffer

Minor modes in effect:
  csv-field-index-mode: t
  shell-dirtrack-mode: t
  c-electric-flag: t
  diff-auto-refine-mode: t
  electric-pair-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent messages:
Continuing.
up-list: Search failed: "mapconcat"
Mark set
Auto-saving...
Saving file /home/monnier/src/emacs/work/lisp/progmodes/etags.el...
Wrote /home/monnier/src/emacs/work/lisp/progmodes/etags.el
Undo! [2 times]
Mark set
user-error: No next conflict
user-error: No previous conflict

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-ref-man hides /home/monnier/src/emacs/elpa/packages/ada-ref-man/ada-ref-man
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-prj hides /home/monnier/src/emacs/work/lisp/progmodes/ada-prj
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-stmt hides /home/monnier/src/emacs/work/lisp/progmodes/ada-stmt
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-mode hides /home/monnier/src/emacs/work/lisp/progmodes/ada-mode
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-xref hides /home/monnier/src/emacs/work/lisp/progmodes/ada-xref
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp

Features:
(cal-french diary-lib diary-loaddefs cal-move org-timer org-table
org-colview org-clock org-attach org-id org-archive org-agenda org-rmail
org-mhe org-irc org-info org-gnus org-docview doc-view jka-compr
image-mode org-bibtex bibtex org-bbdb org-w3m reporter org org-macro
org-footnote org-pcomplete org-list org-faces org-entities org-version
ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs derived csv-mode mule-util network-stream nsm
starttls tls mpc vc-annotate log-view vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs vc-dir reposition shell pcomplete grep etags xref sort
mail-extr emacsbug semantic/bovine/c semantic/db-mode
semantic/decorate/include semantic/decorate/mode semantic/decorate pulse
semantic/bovine/c-by semantic/lex-spp semantic/idle semantic/bovine/gcc
semantic/dep semantic/bovine semantic/analyze/refs semantic/db-find
semantic/db-ref semantic/analyze semantic/sort semantic/scope
semantic/analyze/fcn semantic/db eieio-base semantic/ctxt
semantic/format semantic/tag-ls semantic/find semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
cedet hideif cpp cmacexp cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-langs cc-vars cc-defs compile log-edit
message sendmail dired format-spec rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev mail-utils mailheader pcvs-util bug-reference add-log ffap
misearch multi-isearch smerge-mode whitespace executable copyright
xscheme unsafep trace testcover shadow scheme re-builder profiler
inf-lisp ielm pp comint ansi-color ring gmm-utils ert ewoc debug elp
edebug cl-indent cus-edit cus-start cus-load wid-edit vc vc-dispatcher
vc-git diff-mode filecache eieio-opt speedbar sb-image ezimage dframe
find-func server noutline outline easy-mmode flyspell ispell checkdoc
thingatpt help-mode load-dir elec-pair url-handlers url-parse
auth-source eieio warnings eieio-core cl-generic byte-opt bytecomp
byte-compile cl-extra seq cconv gnus-util time-date mm-util mail-prsvr
password-cache url-vars reveal autoinsert proof-site proof-autoloads
cl-macs cl gv pg-vars savehist minibuf-eldef disp-table edmacro kmacro
cl-loaddefs pcase cl-lib advice help-fns info easymenu finder-inf
package epg-config bbdb-autoloads agda2 vm-autoloads tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind inotify dynamic-setting
font-render-setting x-toolkit x multi-tty emacs)

Memory information:
((conses 8 651814 116033)
 (symbols 24 38858 3) (miscs 20 18909 1482) (strings 16 119446 20729)
 (string-bytes 1 3435542)
 (vectors 8 69693) (vector-slots 4 2293433 165150) (floats 8 749 960)
 (intervals 28 67097 2488)
 (buffers 520 87) (heap 1024 583857 25828))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#20352: Factor 2 slow down of font-locking in c-mode
       [not found] ` <mailman.852.1429234928.904.bug-gnu-emacs@gnu.org>
@ 2015-04-17 19:10   ` Alan Mackenzie
       [not found]     ` <jwv618uukei.fsf-monnier+emacsbugs@gnu.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2015-04-17 19:10 UTC (permalink / raw)
  To: 20352

In article <mailman.852.1429234928.904.bug-gnu-emacs@gnu.org> you wrote:
> Package: Emacs
> Version: 25.0.50


>   src/emacs -Q -nw src/xdisp.c                                          \
>       --eval "(progn (font-lock-fontify-region (point-min) (point-max)) \
>                      (kill-emacs))"

> Is about twice as slow with the code from "master" as it is with the
> code from the emacs-24 branch.

Twice as slow, eh?  You should be so lucky!  I've just tried it, and for
me it's nearer a factor of 10.  ;-(

I'll look at this.

>        Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#20352: Factor 2 slow down of font-locking in c-mode
       [not found]       ` <20150418094552.GA4182@acm.fritz.box>
@ 2015-04-18 17:32         ` Alan Mackenzie
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2015-04-18 17:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 20352

Hello again, Stefan.

Apologies for some misinformation in my previous post.  My timings for
the master branch were on an Emacs configured with no compiler
optimisation.   When I reconfigure and rebuild with default optimisation
the figures look like....

On Sat, Apr 18, 2015 at 09:45:52AM +0000, Alan Mackenzie wrote:
> On Sat, Apr 18, 2015 at 12:35:19AM -0400, Stefan Monnier wrote:
> > > Twice as slow, eh?  You should be so lucky!  I've just tried it, and for
> > > me it's nearer a factor of 10.  ;-(

> > My original case (M-x swiper RET when in src/xdisp.c, while running my
> > locally hacked Emacs on my desktop with all debugging enabled) seemed to
> > be also way past a factor 2 (it just seemed like it would never end and
> > did not have the patience to wait for it to finish), so
> > I made a measurement on a dedicated machine where I recompiled the
> > unadulterated Emacs with default flags and all and got a "disappointing"
> > factor of 2, which still seemed significant enough.

> Some figures:  I tried running (with M-:)
> (let ((start (float-time)))
>   (font-lock-fontify-region (point-min) (point-max))
>   (- (float-time) start))
> on xdisp.c, freshly loaded before each attempt, with 2 versions of Emacs
> and 2 versions of CC Mode.  Here are the timings (in seconds):

> Released Emacs-24.5
>   Emacs-24.5's CC Mode:      29.82369565963745
>   savannah master's CC Mode: 55.37644958496094
> savannah Master
>   Emacs-24.5's CC Mode:      109.47807884216309
>   savannah Master's CC Mode: 241.9050052165985

savannah Master compiled with default optimisation
  Emacs-24.5's CC Mode:      28.840153694152832
  savannah Master's CC Mode: 55.49798059463501

So you were right - the master branch's CC Mode is fontifying at half
speed.  I'm doing some bisecting to try and find the commit which did
this.

> .  So it seems that some changes in CC Mode and some other changes
> outside of CC Mode are both to blame, here.

No, it's a CC Mode thing only.

> >         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#20352: Factor 2 slow down of font-locking in c-mode
  2015-04-17  1:41 bug#20352: Factor 2 slow down of font-locking in c-mode Stefan Monnier
       [not found] ` <mailman.852.1429234928.904.bug-gnu-emacs@gnu.org>
@ 2016-05-16 17:28 ` Paul Eggert
  2016-05-17  9:05   ` Alan Mackenzie
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2016-05-16 17:28 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 20352-done, Stefan Monnier

I just now ran Stefan's benchmark on emacs-25 (commit 
9ca5dbf947a7421d37b3e2d2bc6b8d2c9218bc65) and on my platform (Fedora 23 
x86-64) Emacs 25 is now a bit faster than Emacs 24.5, as the benchmark 
took about 29 s on Emacs 24.5 and about 27 s on Emacs 25. I used the 
Emacs 25 src/xdisp.c in both benchmarks.

Alan, I guess you fixed the performance problem at some point (thanks!). 
As it's listed as a bug blocking Emacs 25, I'm closing the bug report now.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#20352: Factor 2 slow down of font-locking in c-mode
  2016-05-16 17:28 ` Paul Eggert
@ 2016-05-17  9:05   ` Alan Mackenzie
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2016-05-17  9:05 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Stefan Monnier, 20352

Hello, Paul.

On Mon, May 16, 2016 at 10:28:57AM -0700, Paul Eggert wrote:
> I just now ran Stefan's benchmark on emacs-25 (commit 
> 9ca5dbf947a7421d37b3e2d2bc6b8d2c9218bc65) and on my platform (Fedora 23 
> x86-64) Emacs 25 is now a bit faster than Emacs 24.5, as the benchmark 
> took about 29 s on Emacs 24.5 and about 27 s on Emacs 25. I used the 
> Emacs 25 src/xdisp.c in both benchmarks.

That's good to hear!

> Alan, I guess you fixed the performance problem at some point (thanks!). 
> As it's listed as a bug blocking Emacs 25, I'm closing the bug report now.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-17  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-17  1:41 bug#20352: Factor 2 slow down of font-locking in c-mode Stefan Monnier
     [not found] ` <mailman.852.1429234928.904.bug-gnu-emacs@gnu.org>
2015-04-17 19:10   ` Alan Mackenzie
     [not found]     ` <jwv618uukei.fsf-monnier+emacsbugs@gnu.org>
     [not found]       ` <20150418094552.GA4182@acm.fritz.box>
2015-04-18 17:32         ` Alan Mackenzie
2016-05-16 17:28 ` Paul Eggert
2016-05-17  9:05   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).