3 ms·
Java NIO does exactly what you describe. IO is chunked optimally, the entire buffer is pulled, the API exposes a select() mechanism just like any libc, and the
by ubu7737 7y ago
Java NIO does exactly what you describe. IO is chunked optimally, the entire buffer is pulled, the API exposes a select() mechanism just like any libc, and the user is expected to frame its own received data.
edit: Lemire is showing a lack of what Fowler describes as "mechanical sympathy".
https://martinfowler.com/articles/lmax.html#QueuesAndTheirLackOfMechanicalSympathy https://martinfowler.com/articles/lmax.html#QueuesAndTheirLa...
- Matthias247 7y agoA bit of nitpicking on that: Even Javas nio API isn't very efficient. select() introduces a ton of garbage due to dynamically allocating lists for selected keys, and keys have a lot of synchronization overhead. That's why frameworks like Netty gained a lot of performance by building their own selectors using JNI.