RFR: 8253478: (se) epoll Selector should use eventfd for wakeup instead of pipe

Brian Burkhalter bpb at openjdk.java.net
Thu Jan 14 20:47:01 UTC 2021


On Thu, 14 Jan 2021 17:03:55 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> @bplb I think it's too premature to ask us to review this until you have some performance data. Do we have any existing micros for wakeup?
>
> Yes. I have one based on the Wakeup test but it is rather ugly.

This simple benchmark below gives results for the `epoll(7)`-based `Selector` which are three to four percent faster for the version which uses `eventfd(2)` for wakeup.

@State(Scope.Thread)
public class EventFDBench {
    private Selector sel;

    @Setup(Level.Iteration)
    public void setup() throws IOException {
        sel = Selector.open();
    }

    @Benchmark
    public int test() throws IOException {
        return sel.wakeup().select();
    }
}

-------------

PR: https://git.openjdk.java.net/jdk/pull/2082


More information about the nio-dev mailing list