On Tue, Sep 29, 2009 at 1:20 AM, Regis <xu.re...@gmail.com> wrote:

> I think "changes to the selected keys set" doesn't help to show more
> things.
> Because there is no much difference in processSelectResult. And the reason
> for maintaining readableFDs/writableFDs and mapping is avoiding O(num(keys))
> in Selector.select() [1]
>
> What do you think?
>

The optimizations moved work from selectNow() to register() and
SelectionKey.interestOps(). Microbenchmarks that don't exercise those
methods encourage the wrong kind of optimizations.

And the current code is allocation heavy. In select cycles where the number
of the ready keys changes, it allocates and copies O(numReadyKeys) memory.
Unfortunately, the 4879 benchmark doesn't include any of these allocations.

Reply via email to