Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 29848 invoked from network); 1 Oct 2007 16:45:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2007 16:45:19 -0000 Received: (qmail 13051 invoked by uid 500); 1 Oct 2007 16:45:09 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 12522 invoked by uid 500); 1 Oct 2007 16:45:08 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 12513 invoked by uid 99); 1 Oct 2007 16:45:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 09:45:08 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alexei.fedotov@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 16:45:09 +0000 Received: by ug-out-1314.google.com with SMTP id u40so1852297ugc for ; Mon, 01 Oct 2007 09:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=OvtBYy7xl76ANobJVg+6q6D/rPeqR5NoHNGSBpK4Q3c=; b=kq+AHphmv5LSexIHkGyoH/qHbjmzASN9Z6UKJAgBt8tvaAGI8bvBqli3+c0dBh8+y+htBm6Dl+8JkK0jvMWNt8/KHYmCqo2hYVg+6CD2rqg0vIv0VOxyLydhw7O1ksvumxwtZEP+VdMYLPF8eyMjKT1a3y3tfU8X+/SflLrBHbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mkatyVH0XmB6N7ZH80yoYBTmqP51ofVO2PFrqL0NYoqE0Plochg4VvuHvwFvQbsqCdARYH1/cpAakI+8b3zuWhYV9EzJtuT8EDWEWNbl5yHtbdAvUAZra2DajFzvQKn3l5/C/s+joTabEHBsvL40YgJ3lJjIy24vDMDqbGolOTI= Received: by 10.67.27.3 with SMTP id e3mr9100106ugj.1191257086438; Mon, 01 Oct 2007 09:44:46 -0700 (PDT) Received: by 10.67.21.8 with HTTP; Mon, 1 Oct 2007 09:44:46 -0700 (PDT) Message-ID: Date: Mon, 1 Oct 2007 20:44:46 +0400 From: "Alexei Fedotov" To: dev@harmony.apache.org Subject: Re: [classlib][nio] epoll()-based Selector In-Reply-To: <4bebff790710010849q3116964br7d85dc5a5b5f20a7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4bebff790710010849q3116964br7d85dc5a5b5f20a7@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Great job, Aleksey! x320 looks fantastic. I recall that one of my former colleagues hacked callback-based dispatch into Linux kernel to process IP-telephony calls quickly. It's nice to know that now anyone can use this feature just by calling epoll. On 10/1/07, Aleksey Shipilev wrote: > Hi all, > > I would like to present the epoll()-based java.nio.channels.Selector > for Harmony. Epoll facility [1] was developed as the part on Linux > Kernel starting from version 2.5.44, and its interface was finalized > starting before 2.6.x kernels. Epoll is generally driven by callbacks > inside the kernel and thus it strives to be O(1), whereas legacy > poll() and select() are driven by traversing linked lists and thus > being O(n). > > You can find draft implementation at HARMONY-4879 [2]. This version is > ready to play, but not intended for inclusion, since there are a > couple of performance problems persist (like possible O(n^2) at > processSelectResults()). I will try to eliminate them in several days. > However, this patch successfully passes JUnit tests and might be ready > to be tried on some networking-heavy workloads. > > Speaking about performance results, simple test which registers 2000 > channels on one Selector and then continuously calls selectNow() > reveals this: > > Harmony-r576670: > connect time: 100538 msecs > selectNow() time (10000 times): 27777 msecs > > Harmony-r576670 + HARMONY-4879: > connect time: 832 msecs > selectNow() time (10000 times): 87 msecs > > Speedups: > connect: 120x > selectNow(): 320x > > More details are in JIRA. > > Is someone interested in the topic? > I would like to collaborate with you then - to prevent duplication of work :) > > [1] http://lse.sourceforge.net/epoll/index.html > [2] https://issues.apache.org/jira/browse/HARMONY-4879 > -- With best regards, Alexei, ESSD, Intel