From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: `start-process' awfully slow Date: Sun, 14 Apr 2013 14:24:53 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365963908 29693 80.91.229.3 (14 Apr 2013 18:25:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2013 18:25:08 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: York Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 14 20:25:11 2013 Return-path: Envelope-to: geh-help-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 1URRbx-0004zA-4x for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Apr 2013 20:25:09 +0200 Original-Received: from localhost ([::1]:47678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRbw-0004xT-MU for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Apr 2013 14:25:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRbj-0004xB-TD for help-gnu-emacs@gnu.org; Sun, 14 Apr 2013 14:24:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URRbi-0005CR-Q8 for help-gnu-emacs@gnu.org; Sun, 14 Apr 2013 14:24:55 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:45494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRbi-0005Bu-LJ for help-gnu-emacs@gnu.org; Sun, 14 Apr 2013 14:24:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxIEd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJAqIFAbBLZEKA6R6gV6DE4FKJA X-IPAS-Result: Av4EABK/CFFFxIEd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJAqIFAbBLZEKA6R6gV6DE4FKJA X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="7389999" Original-Received: from 69-196-129-29.dsl.teksavvy.com (HELO pastel.home) ([69.196.129.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Apr 2013 14:24:50 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AEEB467923; Sun, 14 Apr 2013 14:24:53 -0400 (EDT) In-Reply-To: (York Zhao's message of "Sat, 13 Apr 2013 11:31:50 -0400") 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: 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:90156 Archived-At: > As mentioned above, when `call-process' is used, it takes 2 seconds > for Clang to generate 15,000 lines of completion results and then the > results gets received by Emacs in a temporary buffer. 2 seconds is > painful but still OK. Which part of those 2 seconds is due to clang, and which part to Emacs? > Because of the slowness, I tried to add the functionality to be able > to call Clang asynchronously so that the keyboard input will not be > blocked while awaiting the completion results. What had driven me > crazy is that it takes more than 15 seconds for Emacs to receive the > 15,000 lines of completion results if `start-process' is is being used > to call the Clang executable. During this 15 seconds I was not typing > anything so Emacs is "idling". The question is why `start-process' > takes 15 seconds while `call-process' takes only 2 seconds, and what > can I do about it? There's no doubt that start-process has to work harder than call-process, but 13s to transfer 15K lines (I assume those lines aren't terribly long, so we might be talking about less than 1MB of data) is too long. I suggest you report it as a bug (via M-x report-emacs-bug), trying to provide as much info as possible to make it reproducible (e.g. replacing clang with a "cat" that simply outputs those 15K lines). Stefan