From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Deffering redisplay in COMINT Date: Fri, 11 Jan 2013 10:55:49 -0500 Message-ID: References: <1354842513.76326.YahooMailNeo@web160901.mail.bf1.yahoo.com> <87obhi1j85.fsf@gmail.com> <1357459792.82082.YahooMailNeo@web160901.mail.bf1.yahoo.com> <1357915224.58763.YahooMailNeo@web160903.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357919763 21012 80.91.229.3 (11 Jan 2013 15:56:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2013 15:56:03 +0000 (UTC) Cc: Vitalie Spinu , Emacs Devel To: Michael Mauger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 11 16:56:20 2013 Return-path: Envelope-to: ged-emacs-devel@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 1Ttgxw-0002LX-2E for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 16:56:20 +0100 Original-Received: from localhost ([::1]:39403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttgxf-0003Py-UU for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 10:56:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtgxZ-0003PN-1l for emacs-devel@gnu.org; Fri, 11 Jan 2013 10:56:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtgxT-0007R1-Bm for emacs-devel@gnu.org; Fri, 11 Jan 2013 10:55:56 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:30700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtgxT-0007Qu-4s for emacs-devel@gnu.org; Fri, 11 Jan 2013 10:55:51 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkGAG6Zu09MCpYP/2dsb2JhbABEgXuyFoEIghUBAQQBViMFCwsOJhIUGA0kLoduBboJkEQDiEKacYFYgwc X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="212302514" Original-Received: from 76-10-150-15.dsl.teksavvy.com (HELO pastel.home) ([76.10.150.15]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Jan 2013 10:55:50 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 8D9BF59441; Fri, 11 Jan 2013 10:55:49 -0500 (EST) In-Reply-To: <1357915224.58763.YahooMailNeo@web160903.mail.bf1.yahoo.com> (Michael Mauger's message of "Fri, 11 Jan 2013 06:40:24 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156223 Archived-At: > but that's what I have to live with). =A0Without the filter and=A0 > auto-hscroll-mode engaged, the results take nearly 30 seconds to=A0 > complete under Emacs. =A0(It is nearly instantaneous=A0outside of Emacs.)= =A0 > With the filter you suggest,=A0the results take about=A08-10 seconds with= =A0 > a=A0noticeable stutter between each row. =A0With the solution=A0I had=A0 > developed (buffering the long lines in a buffer and=A0restoring them=A0at= =A0 > the end of output), the results scroll by quickly in about=A02-3 seconds,= =A0 > but then it hesitates at the end (as it restores the long lines=A0in the= =A0 > buffer),=A0for another 2-3 seconds. =A0So just reducing the horizontal=A0 > scrolling is=A0giving us the big payback and the more complex=A0 > gymnastics=A0is probably=A0not worth code cost. Hmm... I'm wondering why the "one line at a time" approach ends up slightly slower than your more complex approach. Using a single string occurs an O(N^2) overhead (where N is the line length: we receive O(N) packets per line and for each package we do a concat which costs O(N)), so that might be the reason (which is why I suggested using a list of strings, tho it makes detection of the prompt more cumbersome), but for 8KB lines it's not clear it would be that bad. Could you M-x profiler-start ... M-x profiler-report around your tests to see where the time is spent? Stefan