From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.bugs Subject: bug#11822: 24.1; emacsclient terminal mode captures escape characters as text Date: Thu, 24 Sep 2015 04:52:18 -0400 Message-ID: References: <6eipe9fypj.fsf@just-testing.permabit.com> <415962DC-9BF5-4595-8180-7BE8DB545206@permabit.com> <502427D2.3080003@permabit.com> <83ipcre0fm.fsf@gnu.org> <2AB38709-2307-437E-A242-70B8A358BE4F@permabit.com> <83a9y3dwa8.fsf@gnu.org> <838vdndv9m.fsf@gnu.org> <1341183F-84AB-4257-B28B-57BDE5CA4F20@permabit.com> <83r3m97bzs.fsf@gnu.org> <37C523EE-3D76-40F7-B7B2-99D6F0BD7B97@permabit.com> <83bndc7r5b.fsf@gnu.org> <6ea8swr8ja.fsf@just-testing.permabit.com> <83si6n65ld.fsf@gnu.org> <6e613irc91.fsf@just-testing.permabit.com> <83bnda5lso.fsf@gnu.org> <6ezj0tphtd.fsf@just-testing.permabit.com> <83h9n14e04.fsf@gnu.org> <6esi6kpn4t.fsf@just-testing.permabit.com> <834miv92nm.fsf@gnu.org> <83a8sjreso.fsf@gnu.org> <838u80nm2e.fsf@gnu.org> <83k2rhj67q.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443084808 17933 80.91.229.3 (24 Sep 2015 08:53:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2015 08:53:28 +0000 (UTC) Cc: monnier@iro.umontreal.ca, 11822@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 10:53:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zf2HB-0006aU-Hq for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2015 10:53:13 +0200 Original-Received: from localhost ([::1]:53873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf2HA-0004Mh-T6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2015 04:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf2H6-0004MN-63 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 04:53:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf2H1-0003vE-26 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 04:53:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf2H0-0003v9-UK for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 04:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zf2H0-0001OM-PK for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 04:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Raeburn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Sep 2015 08:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11822 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11822-submit@debbugs.gnu.org id=B11822.14430847475304 (code B ref 11822); Thu, 24 Sep 2015 08:53:02 +0000 Original-Received: (at 11822) by debbugs.gnu.org; 24 Sep 2015 08:52:27 +0000 Original-Received: from localhost ([127.0.0.1]:41433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zf2GQ-0001NT-6Q for submit@debbugs.gnu.org; Thu, 24 Sep 2015 04:52:26 -0400 Original-Received: from mail-qk0-f170.google.com ([209.85.220.170]:33197) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zf2GN-0001NJ-3f for 11822@debbugs.gnu.org; Thu, 24 Sep 2015 04:52:23 -0400 Original-Received: by qkdw123 with SMTP id w123so27055840qkd.0 for <11822@debbugs.gnu.org>; Thu, 24 Sep 2015 01:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=permabit.com; s=google; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=d76y8S+viVNuzeB3Fjh5RQGimNZvLWj36+tTBwpJibE=; b=WN/GExiWligGRaIW5jBR2hzW88ilTpBt+EVzqz1eJJ8ievDGgiFdrEQ/jpN472t5HN MHNmEi/y0Yb7sW6ca0xpH8IUMlJwcQZuCEHglg+AnYsvhjJZwCBS9Ab9PlGgfhsdNEL3 VZGeCtsiwPpJOmJhaY29PVa3sSY4+ZS2TR6dU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=d76y8S+viVNuzeB3Fjh5RQGimNZvLWj36+tTBwpJibE=; b=ah5euRKdLSiQcTui9NhveEW9cNsGbPhDIqDujjRXgKhH/pdYKsCh3jRY+VbJ3KPEVC 0SP4AM28rLcba1vTZ7MRfoQmtKI7Ml0SDJWjdO7pNR7Bx7FR44Zv+xCP7ZhVEf8fiphq W7X62bNo1NIXcQyeeMdvMGDSmaUkNi8H4YANdelh+Ksa2ZqAeMpjpxj1kKj9KThh7uDG zmBJJvw+1nSsvExsEnq7zQED6ipsVXQU0uF73KIHsEb6mxQAurhLYkQfvN7C5SFORrPg ZKpNcGurTgyjJU7AtXR2P5IrPpT79Qx11fFM64bKGNzvqmZxKEf5yXTgI7khGJ4k8Bij mb2w== X-Gm-Message-State: ALoCoQlV3YPRfSSiP39JxQCf29yFnfjtVGXc6+kTqZOMrgRyeu/IrqV8EjIEcbt3ZJhDwdm/6Z0z X-Received: by 10.55.197.138 with SMTP id k10mr41018365qkl.20.1443084742383; Thu, 24 Sep 2015 01:52:22 -0700 (PDT) Original-Received: from [192.168.17.111] (c-66-31-203-101.hsd1.ma.comcast.net. [66.31.203.101]) by smtp.gmail.com with ESMTPSA id n10sm4113733qki.24.2015.09.24.01.52.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Sep 2015 01:52:20 -0700 (PDT) In-Reply-To: <83k2rhj67q.fsf@gnu.org> X-Mailer: Apple Mail (2.2104) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106856 Archived-At: > The function that triggers GC is not necessarily the main culprit for > GC. In = http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00081.html > I described how I went about tracking the worst offenders, so I = suggest > you do something similar. Once you have the data based on a = watchpoint > put on consing_since_gc, you can analyze it to see which code is > responsible for most of the consing. With that data in hand, we could > see if there's something we can do about that. I printed out stack traces when consing_since_gc changed. That turns out = to be a lot of raw data :-) =E2=80=A6 it took 5.5 CPU hours under gdb to = get the frame created and the data recorded. It=E2=80=99s over 120MB of = text, so I=E2=80=99m working on distilling it down to something that = might be useful. Some highlights so far: In this run, I recorded over 601000 bytes being allocated; about 60% of = that (~364000) was done from things called by parse_single_submenu; = about half of that (~185000), in turn, was via larger_vector called from = ensure_menu_items. The largest of those was a single allocation of 62000 = bytes. There were several more of these calls, with smaller sizes, and = varying in the nesting depth of single_menu_item and friends. The next couple paths resulting in the most bytes allocated were list = creations from Lisp code: 39104 bytes across 2444 allocations with the Lisp backtrace: = set-face-attribute apply face-spec-reset-face face-spec-recalc = face-set-after-frame-default x-create-frame-with-faces = PVEC_COMPILED@0x121eac8 apply frame-creation-function make-frame = make-frame-command funcall-interactively call-interactively = command-execute 36288 bytes across 2268 allocations with the Lisp backtrace: append = apply face-spec-reset-face [=E2=80=A6 as above] 58320 bytes across 3645 allocations via mapcar or the function mapcar = applies, called from face-spec-reset-face There were also 54360 bytes allocated along various paths from = directory-files, which as far as I can tell is only used to test for the = existence of any file in ~/.emacs.d/auto-save-list with a name starting = with =E2=80=9C.saves-=E2=80=9D. If any exist, the =E2=80=9CRecover = Crashed Session=E2=80=9D menu item is enabled. But I know of no way to = do just the pattern matching and existence test without fetching all the = other data. The amount of wasted allocations are dependent on the = content of my directory, of course. This stuff described above is all during the execution of = =E2=80=9Cmake-frame-command=E2=80=9D invoked via C-x 5 2. After that = command completes, there are more allocations driven out of = redisplay_internal or timers =E2=80=94 enough that garbage collection = ran a second time =E2=80=94 but I=E2=80=99m not sure which are normal = parts of the create-and-display-frame sequence (loading image files) and = which may be artifacts of how I did the test or how I was using the = machine (e.g., random X events caused by my moving other windows around = to get real work done over the span of a few hours). Ken=