DatagramChannel performance issue (original) (raw)
Martin Thompson mjpt777 at gmail.com
Sat Aug 25 16:42:23 UTC 2018
- Previous message: JEP 330 class loader getResourceAsStream
- Next message: JVM Interpreter
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
We've been diagnosing a performance issue and isolated it to receiving on a datagram socket where we are seeing a significant step down in performance, and increase in allocation, when more than one source is sending.
When receiving from two or more sources we get InetAddress and InetSocketAddress objects allocated and they are set via multiple up calls from the JNI code into Java.
A much more efficient implementation would be one that passes down two ByteBuffers. One to be filled in for the payload and one for the header. Allocation on a per packet receive is not a useful design for a network API.
A read operation is not a valid alternative as we need the sender address.
Regards, Martin...
- Previous message: JEP 330 class loader getResourceAsStream
- Next message: JVM Interpreter
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]