From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Unbuffered socket I/O Date: Tue, 27 Feb 2007 10:11:20 +0100 Organization: LAAS-CNRS Message-ID: <87irdox8w7.fsf@laas.fr> References: <87mz34ol6r.fsf@laas.fr> <87abz13kxl.fsf@zip.com.au> <877iu59fm8.fsf@laas.fr> <87odng64o3.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1172567497 26492 80.91.229.12 (27 Feb 2007 09:11:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2007 09:11:37 +0000 (UTC) Cc: Guile-Devel To: Neil Jerram Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 27 10:11:30 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HLyMo-00040p-VI for guile-devel@m.gmane.org; Tue, 27 Feb 2007 10:11:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HLyMo-00075P-BI for guile-devel@m.gmane.org; Tue, 27 Feb 2007 04:11:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HLyMl-00075K-IT for guile-devel@gnu.org; Tue, 27 Feb 2007 04:11:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HLyMk-000758-9p for guile-devel@gnu.org; Tue, 27 Feb 2007 04:11:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HLyMk-000755-6g for guile-devel@gnu.org; Tue, 27 Feb 2007 04:11:22 -0500 Original-Received: from laas.laas.fr ([140.93.0.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1HLyMj-0003RF-N6 for guile-devel@gnu.org; Tue, 27 Feb 2007 04:11:22 -0500 Original-Received: from messiaen.laas.fr (messiaen [IPv6:2001:660:6602:0:230:65ff:fed4:9d20]) by laas.laas.fr (8.13.8/8.13.8) with SMTP id l1R9BJsv000451; Tue, 27 Feb 2007 10:11:19 +0100 (MET) Original-Received: by messiaen.laas.fr (sSMTP sendmail emulation); Tue, 27 Feb 2007 10:11:20 +0100 X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 9 =?iso-8859-1?Q?Vent=F4se?= an 215 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Neil Jerram , Guile-Devel In-Reply-To: <87odng64o3.fsf@ossau.uklinux.net> (Neil Jerram's message of "Mon, 26 Feb 2007 20:32:28 +0000") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Spam-Score: -0.001 () NO_RELAYS X-Scanned-By: MIMEDefang at CNRS-LAAS on IPv6:2001:660:6602::2 X-detected-kernel: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6578 Archived-At: --=-=-= Hi, Neil Jerram writes: > I have no technical objection to your patch, but I'm afraid you must > be missing something, or else there is something special about the > environment that you were measuring in. I have played with a few > TCP-based Guile applications (including the Emacs debugging interface) > and not noticed any obvious performance problem. I tried the attached script, both with and without the patch. Here, it says "time: 7" with the patch and "time: 2645" without. Now, it seems that I was observing an even higher difference because the Guile server script was running under `strace'... :-) Thanks, Ludovic. --=-=-= Content-Disposition: inline; filename=socket-perf.scm Content-Description: Test program. (use-modules (srfi srfi-4)) (define %port 7778) (define %size 5000000) (define (time thunk) (let ((start (get-internal-run-time))) (thunk) (let ((end (get-internal-run-time))) (format #t "time: ~a~%" (- end start))))) (if (= 0 (primitive-fork)) (let ((s (socket PF_INET SOCK_STREAM 0))) (bind s AF_INET INADDR_LOOPBACK %port) (listen s 1024) (format #t "accepting connections...~%") (let* ((accepted (accept s)) (port (car accepted)) (vec (make-u8vector %size))) (time (lambda () (uniform-vector-read! vec port))) (close-port port))) (let ((s (socket PF_INET SOCK_STREAM 0)) (vec (make-u8vector %size))) (format #t "client~%") (sleep 1) (connect s AF_INET INADDR_LOOPBACK %port) (format #t "writing...~%") (uniform-vector-write vec s) (format #t "done.~%") (close-port s))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--