From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David.Kastrup@t-online.de (David Kastrup) Newsgroups: gmane.emacs.devel Subject: Re: Any idea about what makes Emacs slow reading on pipes? Date: 16 May 2003 20:38:56 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: dak@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1053111176 30392 80.91.224.249 (16 May 2003 18:52:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 16 May 2003 18:52:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 16 20:52:51 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19GkBN-0007B4-00 for ; Fri, 16 May 2003 20:43:53 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19GkJq-0007jr-00 for ; Fri, 16 May 2003 20:52:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GkBH-0007Dh-02 for emacs-devel@quimby.gnus.org; Fri, 16 May 2003 14:43:47 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19Gk8h-0006fD-00 for emacs-devel@gnu.org; Fri, 16 May 2003 14:41:07 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19Gk74-0005dN-00 for emacs-devel@gnu.org; Fri, 16 May 2003 14:39:29 -0400 Original-Received: from mailout05.sul.t-online.com ([194.25.134.82]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19Gk6s-00050r-00 for emacs-devel@gnu.org; Fri, 16 May 2003 14:39:14 -0400 Original-Received: from fwd09.sul.t-online.de by mailout05.sul.t-online.com with smtp id 19Gk6m-0004sq-02; Fri, 16 May 2003 20:39:08 +0200 Original-Received: from localhost.localdomain (520018396234-0001@[62.226.11.196]) by fwd09.sul.t-online.com with esmtp id 19Gk6c-1PfZkeC; Fri, 16 May 2003 20:38:58 +0200 Original-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h4GIcv2l032318; Fri, 16 May 2003 20:38:57 +0200 Original-Received: (from dak@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id h4GIcu7j032314; Fri, 16 May 2003 20:38:56 +0200 Original-To: "Jan D." In-Reply-To: Original-Lines: 85 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Sender: 520018396234-0001@t-dialin.net X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13939 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13939 --=-=-= "Jan D." writes: > > > > The following exhibits abysmal speed within Emacs: > > > > (let (process-connection-type) (switch-to-buffer (generate-new-buffer > > "*test*"))(erase-buffer)(start-process "test" (current-buffer) "sh" > > "-c" "hexdump -v /dev/zero|dd bs=1 count=100k")(erase-buffer)) > > ... > > > The system I see this in is > > GNU Emacs 21.3.50.3 (i686-pc-linux-gnu) > > a RedHat 9 system, but I have seen this in practically every Linux > > system up to now. Is this a Linux-specific problem, or do others see > > this as well? > > I could not reproduce this on a slackware (version unknown, but libc 6) > or a Mandrake 9.0 system. Maybe running under strace can give some > indication of the system call that takes time (if that is the issue)? Here is a more elaborate test file --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=testio.el Content-Description: Check filter function strangeness (defvar test-pattern nil) (defvar test-start nil) (defun test-filter (process string) (push (cons (length string) (time-since test-start)) test-pattern) (with-current-buffer (process-buffer process) (insert-before-markers string))) (defun make-test nil (interactive) (switch-to-buffer (get-buffer-create "*test*")) (erase-buffer) (setq test-pattern nil test-start (current-time)) (set-process-filter (start-process "test" (current-buffer) "sh" "-c" "hexdump -v /dev/zero|dd bs=1 count=100k") #'test-filter)) --=-=-= If I run this and print out test-pattern afterwards, I get test-pattern ((485 0 11) (1024 0 11) (1024 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1023 0 11) (1024 0 11) (1024 0 11) (1024 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 11) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1023 0 10) (1024 0 10) (1024 0 10) (1024 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1023 0 10) (1024 0 10) (1024 0 10) (1024 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1 0 10) (1023 0 10) [...] (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1023 0 8) (1024 0 8) (1024 0 8) (1024 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 8) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1023 0 7) (1024 0 7) (1024 0 7) (1024 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1023 0 7) (1024 0 7) (1024 0 7) (1024 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 0 7) (1 [...] 0 6) (1 0 6) (1 0 6) (1 0 6) (1023 0 6) (1024 0 6) (1024 0 6) (1024 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1023 0 6) (1024 0 6) (1024 0 6) (1024 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 0 6) (1 And from then on (actually backwards in time) only packets with single characters, with perhaps 100 filter calls per second. Which in itself is not too hot a speed, but gets awful in consequence because the filter routine gets only called for single characters. I don't know _what_ Emacs does do the pipe/pty that causes only single characters to gather/be processed, with a sporadic 1024 packet getting through from time to time, but I hate it. Some setting must be on the pipe that causes the writer to stall before further writes in many cases until Emacs has read the next character. And after some time the pipe gets filled properly now and then, with single characters in between. I don't get it. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --=-=-=--