unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Taylor Venable <taylor@metasyntax.net>
To: help-gnu-emacs@gnu.org, emacs-devel@gnu.org
Subject: Re: Strange slowness when killing words interactively
Date: Sun, 1 May 2011 20:22:37 -0400	[thread overview]
Message-ID: <BANLkTi=mrq9fo8fd0m08hmQo4DC-xi=u7g@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin5-Z+OLzBmMUvt_mh8gFd_isp=Fg@mail.gmail.com>

On Tue, Apr 26, 2011 at 21:30, Taylor Venable <taylor@metasyntax.net> wrote:
> Hi, I'm having a strange problem with C-<backspace>
> (backward-kill-word) and looking for some help in trying to debug it.
> When I use this keystroke, the CPU usage spikes. The same goes for
> C-<delete> (forward-kill-word) or any other key that I bind to either
> of these functions. Other functions, such as backward-kill-sexp and
> backward-kill-sentence, are similarly problematic. As a result, when I
> hold the key down, my high repeat rate makes Emacs unresponsive for a
> second until whatever is slowing down catches up. It happens with the
> GTK GUI, but not with the text user interface. None of my other
> machines have this behaviour with the same version of Emacs (that
> includes one machine which is running the same distribution [Arch
> Linux] with the same packages). No other programs on this system are
> affected by performance problems when deleting words of text from a
> block. The problem occurs with and without using -q. There does not
> seem to be the same problem if I run the kill function itself with
> C-u; for example, C-u 1000 backward-kill-word is instant. What's the
> best way to profile this and figure out where my CPU cycles are being
> eaten? Thanks for any help, my version information is below. I built
> from fully updated bzr trunk tonight.
>
> M-x emacs-version
> GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.1) of
> 2011-04-26
>
> gcc --version
> gcc (GCC) 4.6.0 20110415 (prerelease)
>
> uname -a
> Linux system76 2.6.38-ARCH #1 SMP PREEMPT Sun Apr 17 15:18:58 CEST
> 2011 x86_64 Intel(R) Core(TM) i7 CPU 870 @ 2.93GHz GenuineIntel
> GNU/Linux

(Adding emacs-devel since I've started looking at the source code.)

I've found the location where the slowness creeps into kill-word and
friends. Looking at kill-region in simple.el, the part that is very
slow for my system is adding to the kill ring. If I comment those
lines out (as shown in http://paste.lisp.org/+2LWP) then the sluggish
response disappears. It's odd to me that I don't see this behaviour
when I start Emacs with -nw as I would (perhaps naively) think that
slowness in kill-region would be independent of what user interface is
active.

-- 
Taylor C. Venable
http://metasyntax.net/



       reply	other threads:[~2011-05-02  0:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTin5-Z+OLzBmMUvt_mh8gFd_isp=Fg@mail.gmail.com>
2011-05-02  0:22 ` Taylor Venable [this message]
2011-05-02  1:13   ` Strange slowness when killing words interactively Chong Yidong
2011-05-02  4:25     ` Taylor Venable
2011-05-02 16:32       ` David De La Harpe Golden
2011-05-03  1:14         ` Taylor Venable
2011-05-03  4:30           ` David De La Harpe Golden
2011-05-03  5:12             ` Stephen J. Turnbull
2011-05-03 11:51               ` Taylor Venable
2011-05-04  5:36                 ` David De La Harpe Golden
2011-05-07  2:52                   ` Taylor Venable
2011-05-09  1:18                     ` David De La Harpe Golden
2011-05-09  3:08                       ` David De La Harpe Golden
2011-05-14 12:59                         ` Taylor Venable
2011-05-16 22:32                           ` Chong Yidong
2011-05-16 23:01                             ` David De La Harpe Golden
2011-05-17 17:31                               ` Chong Yidong
2011-05-17 17:48                                 ` David De La Harpe Golden
2011-05-17 19:05                                   ` David De La Harpe Golden

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='BANLkTi=mrq9fo8fd0m08hmQo4DC-xi=u7g@mail.gmail.com' \
    --to=taylor@metasyntax.net \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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 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).