From owner-freebsd-java@FreeBSD.ORG Thu Aug 23 18:25:51 2007 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1CE16A418 for ; Thu, 23 Aug 2007 18:25:51 +0000 (UTC) (envelope-from freebsd@spatula.net) Received: from turing.morons.org (turing.morons.org [208.96.51.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4F53513C46B for ; Thu, 23 Aug 2007 18:25:51 +0000 (UTC) (envelope-from freebsd@spatula.net) Received: by turing.morons.org (Postfix, from userid 1001) id EE6CC17033; Thu, 23 Aug 2007 11:25:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id EB67417030 for ; Thu, 23 Aug 2007 11:25:48 -0700 (PDT) Date: Thu, 23 Aug 2007 11:25:48 -0700 (PDT) From: Nick Johnson X-X-Sender: spatula@turing To: freebsd-java@freebsd.org Message-ID: <20070823111051.N82369@turing> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: making nio use kevent/kqueue X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2007 18:25:51 -0000 I think there could be a considerable performance gain if java.nio were tweaked to use kevent/kqueue(2) as opposed to poll(2). It looks like the files that would need to be touched for this are: j2se/src/solaris/native/sun/nio/ch/ DevPollArrayWrapper.c (not sure about this one actually since FreeBSD doesn't use /dev/poll) PollArrayWrapper.c SocketChannelImpl.c Does that sound about right? I see select(2) and poll(2) used in other places as well, though outside of nio where they're likely to show the greatest benefit. Are there any caveats or "gotchas" I should be aware if should I decide to take some free time to try to come up with a kevent patch for nio? Also, is there a quicker way to build a JVM when just changing a file or two like this? It would be lousy to have to wait 2 hours to build after every minor change... Nick -- "Courage isn't just a matter of not being frightened, you know. It's being afraid and doing what you have to do anyway." Doctor Who - Planet of the Daleks This message has been brought to you by Nick Johnson 2.3b1 and the number 6. http://healerNick.com/ http://morons.org/ http://spatula.net/