From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylor Venable Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: Re: Strange slowness when killing words interactively Date: Sun, 1 May 2011 20:22:37 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1304295773 27946 80.91.229.12 (2 May 2011 00:22:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 May 2011 00:22:53 +0000 (UTC) To: help-gnu-emacs@gnu.org, emacs-devel@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 02 02:22:49 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QGguW-0003xO-4w for geh-help-gnu-emacs@m.gmane.org; Mon, 02 May 2011 02:22:48 +0200 Original-Received: from localhost ([::1]:42120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGguV-0000v3-1h for geh-help-gnu-emacs@m.gmane.org; Sun, 01 May 2011 20:22:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGguO-0000uw-Ug for help-gnu-emacs@gnu.org; Sun, 01 May 2011 20:22:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGguM-0005XZ-MO for help-gnu-emacs@gnu.org; Sun, 01 May 2011 20:22:40 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:53879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGguM-0005XF-H5; Sun, 01 May 2011 20:22:38 -0400 Original-Received: by iwg8 with SMTP id 8so6175988iwg.0 for ; Sun, 01 May 2011 17:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=ef98CPOb0CwQXrh9gC50TZctZvfUWbXuzcmv0MW2iiA=; b=LwQr7DAe8D3J3vkIITzdlhOS9i82TpUo9FnZMkqAuV8R3gx6nwumqmSStK43pUPHD6 6CEJOqhemXO+hZsy7EAeq04/nvHpF9S7NVuN/ElQay2SDffMkJaSN7x0vAj2HVtdaV4O 2ZCWl0h1R1nZ1jcdmikjSlbdRcLP3bP67wnUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=YSbWlFQl9+xoNcXSHIhu6t8+Ty0OoVAXGPs/Lzbt5yP+vwwKTweKMg7oBu2Y8R4nis 69VBKDHFWyKf9fSt7YozGOeyszytTt8EfzL2t+6IRJBnn2nM5aQoFAeabkG/fIk6LlRB hiqxgP/YNPTOd2kUWBzT8gKTc2sHJFh49+IQw= Original-Received: by 10.42.244.72 with SMTP id lp8mr9258497icb.117.1304295757090; Sun, 01 May 2011 17:22:37 -0700 (PDT) Original-Received: by 10.231.143.135 with HTTP; Sun, 1 May 2011 17:22:37 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: cVm3poi_0_7GVwwad5BPcCTuFRc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80894 gmane.emacs.devel:138949 Archived-At: On Tue, Apr 26, 2011 at 21:30, Taylor Venable wrote: > Hi, I'm having a strange problem with C- > (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- (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/