From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16875: python, comint-mode: Large output makes Emacs freeze Date: Wed, 25 Jun 2014 10:26:30 -0400 Message-ID: References: <530C60A7.1030009@easy-emacs.de> <87bnth4whf.fsf@gnu.org> <53AA5DA5.8060700@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1403706550 26975 80.91.229.3 (25 Jun 2014 14:29:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Jun 2014 14:29:10 +0000 (UTC) Cc: 16875@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 25 16:29:04 2014 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 1WzoC3-0006mN-IL for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Jun 2014 16:28:59 +0200 Original-Received: from localhost ([::1]:38212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzoC3-0007QN-3d for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Jun 2014 10:28:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzoAH-0004HK-4d for bug-gnu-emacs@gnu.org; Wed, 25 Jun 2014 10:27:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzoAB-0007YC-78 for bug-gnu-emacs@gnu.org; Wed, 25 Jun 2014 10:27:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzoAB-0007XI-4O for bug-gnu-emacs@gnu.org; Wed, 25 Jun 2014 10:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WzoAA-0005FD-Fq for bug-gnu-emacs@gnu.org; Wed, 25 Jun 2014 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jun 2014 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16875-submit@debbugs.gnu.org id=B16875.140370639720112 (code B ref 16875); Wed, 25 Jun 2014 14:27:02 +0000 Original-Received: (at 16875) by debbugs.gnu.org; 25 Jun 2014 14:26:37 +0000 Original-Received: from localhost ([127.0.0.1]:60577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wzo9k-0005EJ-2j for submit@debbugs.gnu.org; Wed, 25 Jun 2014 10:26:36 -0400 Original-Received: from relais.videotron.ca ([24.201.245.36]:30106) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wzo9g-0005E0-Aq for 16875@debbugs.gnu.org; Wed, 25 Jun 2014 10:26:33 -0400 Original-Received: from ceviche.home ([24.201.170.218]) by VL-VM-MR003.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N7Q008JAAS6E680@VL-VM-MR003.ip.videotron.ca> for 16875@debbugs.gnu.org; Wed, 25 Jun 2014 10:26:30 -0400 (EDT) Original-Received: by ceviche.home (Postfix, from userid 20848) id 0D5E066167; Wed, 25 Jun 2014 10:26:30 -0400 (EDT) In-reply-to: <53AA5DA5.8060700@easy-emacs.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) 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: 140.186.70.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:90785 Archived-At: >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13675 > To a certain extend. > There some more operations done by comint, which aren't needed when > executing Python code from source but may slow down it. I expect the main slowdown comes from font-lock. But indeed, it''d be good to try and profile it to see where the time is spent. Last time I tried to speed up M-x grep, I changed compile.el so that it only processes (font-lock and friends) the output up to the last \n. This way, when a very long line is received in 100 chunks, it doesn't get re-processed 100 times. Maybe comint.el could do the same (especially since it already assumes that "text between the last \n and EOB is a prompt"). > Thus solution in python-mode.el is to surpass comint-mode completely and use > "start-process" and "process-send-string" If the problem is really in "unneeded comint functionality" (or call it "bloat"), that's an option, but of course if we don't know where the performance problem comes, we may end up with the same problem anyway. > Indeed, "pprint" should solve it already. Maybe make that the default? > IMO looks better anyway. [ I don't use Python, so I don't have an opinion on that, but if it works, fine by me. ] Maybe comint.el could also be changed so that it "wraps" lines if they get past some arbitrary maximum length (like 10K chars, for example). It wouldn't be a great solution, but if the performance sucks really bad past 10K chars, wrapping the line might be a lesser evil. Stefan