DatagramChannel performance issue

Chris Hegarty chris.hegarty at oracle.com
Mon Aug 27 20:10:19 UTC 2018


> On 27 Aug 2018, at 20:09, Martin Thompson <mjpt777 at gmail.com> wrote:
> 
>>> ...
>> The SocketAddress type would also need to be encoded into the source
>> buffer if there were to an API like this. I think it would be better to
>> start out by improving the implementation of the existing receive method
>> to eliminate the need to construct objects or set fields in the JNI
>> code. Is this something that you would like to contribute?
> 
> I'd be happy to help if I can. How do you think the existing method
> can be improved? Would there need to be some sort of cache of address
> objects to honour the existing receive API which returns an address?

In your particular use-case, approximately how many unique source
addresses are you observing?  Since there is a single cached
address, just two alternating sources will result in additional up-calls
and object allocation, right?

-Chris.



More information about the nio-dev mailing list