DatagramChannel performance issue
Alan Bateman
Alan.Bateman at oracle.com
Mon Sep 3 07:39:14 UTC 2018
On 03/09/2018 07:53, Martin Thompson wrote:
> :
> Can you provide a link to an example of how to "pass in an area of
> memory"? Is this different than the ByteBuffer example for the header
> I provided?
I don't think we have other examples in the core libraries to point.
DatagramSocketImpl just needs a direct buffer for the socket address
which the new native receive method will populate with the source address.
> :
> Let me know if you'd like further refinements. While putting this
> together it is clear there is a performance difference on the send vs
> write calls which I'll separately quantify.
>
Which operating system is this? You may want to run it with
-Djava.net.preferIPv4Stack=true to see if it makes a difference (as IPv6
targets, even if it's an IPv4-mapped IPv6 address, as IPv6 targets
involves additional code).
-Alan
More information about the nio-dev
mailing list