all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: emacs-devel@gnu.org
Cc: Alan Mackenzie <acm@muc.de>, Eli Zaretskii <eliz@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: Scrolling huge buffers and cc-mode
Date: Wed, 19 Dec 2012 11:20:55 +0400	[thread overview]
Message-ID: <50D16AD7.5060005@yandex.ru> (raw)
In-Reply-To: <50D158F9.2070303@yandex.ru>

It looks like the reason of slow scrolling is how the C++ namespaces are handled.

Basically my test file is:

namespace X {
namespace Y {

/* 13K lines of code */

} }

/* middle-point */

namespace X {
namespace Y {

/* 13K lines of code */

} }

When scrolling reaches middle-point, everything hangs, most probably because
we need to scan huge regions (first and second namespace blocks). When I remove
all namespace definitions (with matched '}'), scrolling works much faster.
Corresponding profile is:

     13.04%        emacs  emacs                          [.] mark_object
      7.70%        emacs  emacs                          [.] exec_byte_code
      6.79%        emacs  emacs                          [.] re_match_2_internal
      6.48%        emacs  emacs                          [.] lookup_char_property
      4.70%        emacs  emacs                          [.] scan_sexps_forward
      4.67%        emacs  emacs                          [.] Fgarbage_collect
      4.62%        emacs  emacs                          [.] re_compile_pattern
      4.57%        emacs  emacs                          [.] next_interval
      3.29%        emacs  emacs                          [.] find_interval
      3.16%        emacs  emacs                          [.] mark_interval
      2.15%        emacs  emacs                          [.] Fcdr
      2.06%        emacs  emacs                          [.] update_syntax_table
      1.83%        emacs  emacs                          [.] Flocal_variable_p
      1.33%        emacs  emacs                          [.] Fassq
      1.19%        emacs  emacs                          [.] balance_intervals_internal
      1.13%        emacs  emacs                          [.] Ffuncall
      1.00%        emacs  emacs                          [.] compile_pattern

This is very similar to what I'm seeing while scrolling over xdisp.c:

     13.92%        emacs  emacs                          [.] mark_object
      8.20%        emacs  emacs                          [.] exec_byte_code
      4.91%        emacs  emacs                          [.] re_match_2_internal
      4.78%        emacs  emacs                          [.] Fgarbage_collect
      4.65%        emacs  emacs                          [.] lookup_char_property
      3.60%        emacs  emacs                          [.] find_interval
      3.55%        emacs  emacs                          [.] scan_sexps_forward
      3.45%        emacs  emacs                          [.] re_compile_pattern
      2.77%        emacs  emacs                          [.] Flocal_variable_p
      2.71%        emacs  emacs                          [.] mark_interval
      2.46%        emacs  emacs                          [.] next_interval
      1.62%        emacs  emacs                          [.] update_syntax_table
      1.52%        emacs  emacs                          [.] Fassq
      1.45%        emacs  emacs                          [.] Fcdr
      1.35%        emacs  emacs                          [.] Ffuncall
      1.11%        emacs  emacs                          [.] compile_pattern

Dmitry




  reply	other threads:[~2012-12-19  7:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18  9:56 Scrolling huge buffers and cc-mode Dmitry Antipov
2012-12-18 17:30 ` Eli Zaretskii
2012-12-18 19:58   ` Stefan Monnier
2012-12-19  6:04     ` Dmitry Antipov
2012-12-19  7:20       ` Dmitry Antipov [this message]
2012-12-19 22:39         ` Alan Mackenzie
2012-12-20  0:52           ` Michael Welsh Duggan
2012-12-20 22:29         ` Alan Mackenzie
2012-12-21  5:15           ` Dmitry Antipov
2012-12-21 10:57             ` Alan Mackenzie
2012-12-22  3:28               ` Chong Yidong
2012-12-18 19:40 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D16AD7.5060005@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.