From owner-freebsd-java Mon Feb 23 14:36:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA29045 for freebsd-java-outgoing; Mon, 23 Feb 1998 14:36:01 -0800 (PST) (envelope-from owner-freebsd-java@FreeBSD.ORG) Received: from internetdevices.com (idi-fk-gw.abhiweb.com [205.138.236.250]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA28987; Mon, 23 Feb 1998 14:35:51 -0800 (PST) (envelope-from iyer@internetdevices.com) Received: from internetdevices.com (localhost [127.0.0.1]) by internetdevices.com (8.8.7/8.8.7) with ESMTP id OAA22008; Mon, 23 Feb 1998 14:34:32 -0800 (PST) Message-ID: <34F1F777.BEC2F180@internetdevices.com> Date: Mon, 23 Feb 1998 14:26:01 -0800 From: Iyer Mahadevan X-Mailer: Mozilla 4.04 [en] (X11; I; SunOS 5.4 sun4m) MIME-Version: 1.0 To: java@FreeBSD.ORG, iyer@internetdevices.com, saurabh@internetdevices.com, freebsd-java@FreeBSD.ORG, java-port@FreeBSD.ORG Subject: Socket IO problems using Java Sockets on FreeBSD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I noticed some serious performance problems with Java Socket I/O. I set up en echo server that echoes the request back to the client. I found that there were serious performance problems when data was being written to the socket and read at the other end 133 MH 64 MB FreeBSD 2.2-STABLE Request read time = Time request read by server - Time request sent by client Reply read time = Time reply read by client - Time reply sent by server Total time = Time received reply - Time connected to server Server Client Request read time Reply read time Total Time C C 194 2 200 Java C 400 Java Java 191 199 400 Next I decided to take a look at the corresponding performance on a Sparc 4 70 MH 64 MB SunOS Release 5.4 Server Client Request read time Reply read time Total Time C C 41 49 98 Java C 103 Java Java 44 46 111 Note: 1. I took 5 samples for each case 2. Both client and server were running on the same machine (used localhost to connect) Questions 1. Do you understand why the socket I/O is twice as expensive on FreeBSD for (C Server - C Client) 2. Do you understand why the socket I/O is 4 times as expensive on FreeBSD for (Java Server - C Client) PS : Let me know if you need any code, any generic Java/C socket code should do To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message