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 10:04:41 +0400	[thread overview]
Message-ID: <50D158F9.2070303@yandex.ru> (raw)
In-Reply-To: <jwvk3sfxhe3.fsf-monnier+emacs@gnu.org>

On 12/18/2012 11:58 PM, Stefan Monnier wrote:

>> about 1 minute is below.  If I understand correctly, it blames
>> scan-sexps for most of the CPU load.
>
> Indeed, but running scan-sexps on the whole buffer doesn't take that
> long, so the problem is not that scan-sexps is slow, but that it's
> called too many times.

I didn't try to profile elisp, but here is what I'm seeing at the lower level.
Since the percentage of exec_byte_code is just 1.21%, I suspect that elisp
is not a bottleneck here. Looking at enormous percentage of lookup_char_property
and next_interval, I would rather suspect an issue with interval trees.

Dmitry

# ========
# captured on: Tue Dec 18 19:30:31 2012
# hostname : localhost.localdomain
# os release : 3.6.10-2.fc17.x86_64
# perf version : 3.6.10-2.fc17.x86_64
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
# cpuid : GenuineIntel,6,42,7
# total memory : 3930292 kB
# cmdline : /usr/bin/perf record -e stalled-cycles-frontend -e stalled-cycles-backend -F 10000 ./src/emacs -Q ../../misc/huge.cc
# event : name = stalled-cycles-frontend, type = 0, config = 0x7, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host
# event : name = stalled-cycles-backend, type = 0, config = 0x8, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# ========
#
# Samples: 3M of event 'stalled-cycles-frontend'
# Event count (approx.): 284964331659
#
# Overhead      Command                  Shared Object                                                  Symbol
# ........  ...........  .............................  ......................................................
#
     22.65%        emacs  emacs                          [.] lookup_char_property
     21.21%        emacs  emacs                          [.] scan_sexps_forward
     17.65%        emacs  emacs                          [.] next_interval
      8.29%        emacs  emacs                          [.] Fcdr
      4.66%        emacs  emacs                          [.] update_syntax_table
      2.15%        emacs  emacs                          [.] scan_lists
      1.95%        emacs  emacs                          [.] mark_object
      1.92%        emacs  emacs                          [.] update_interval
      1.74%        emacs  emacs                          [.] Fassq
      1.41%        emacs  emacs                          [.] back_comment
      1.38%        emacs  emacs                          [.] forw_comment
      1.21%        emacs  emacs                          [.] exec_byte_code
      1.08%        emacs  emacs                          [.] char_quoted
      1.05%        emacs  emacs                          [.] re_match_2_internal
      0.70%        emacs  emacs                          [.] re_compile_pattern
      0.67%        emacs  emacs                          [.] Fgarbage_collect
      0.58%        emacs  emacs                          [.] find_interval




  reply	other threads:[~2012-12-19  6:04 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 [this message]
2012-12-19  7:20       ` Dmitry Antipov
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=50D158F9.2070303@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.