News for hackers. Stuff that matters.
Re:Jodd – The Unbearable Lightness of Java by WatchDog on Monday January 17, 2022 @06:46PM (#29973032)
Netty core is about as close to the metal as networking gets on the JVM. It's abstractions are built over a zero-copy capable byte buffer, and there is generally a lot of care taken to avoid copying where possible. I haven't used the websocket codec, but I'm sure the maintainers would welcome a patch that removes unnecessary copying.
Re:Jodd – The Unbearable Lightness of Java by winrid on Monday January 17, 2022 @07:32PM (#29973393)
Here's what I was thinking of, under "Vert.x Memory Usage": https://www.tikalk.com/posts/2018/04/30/vertx-memory-usage-w...

Quote: "But how does Netty do things so fast ? One of the reasons is that it is using native memory pool to store network buffers. If you did some file reading or network action with Vert.x you probably used io.vertx.core.buffer.Buffer class. This class is actually a wrapper around Netty io.netty.buffer.ByteBuf class. Why am I telling you all this ? Let assume that you have a service where clients are downloading 20Mbyte files. Netty will have to allocate at least 20Mbyte for every connected client."

Although this may be an issue with how Vert.x is using Netty. I have to dig into it more.

Re:Jodd – The Unbearable Lightness of Java by WatchDog on Monday January 17, 2022 @10:24PM (#29974661)
FWIW, here is a fairly minimal example[0] of broadcasting over websockets reusing the same buffer.

I'm not very familiar with vert.x(not a netty expert either), but I think the author of that article is ascribing blame to the wrong place.

[0]: https://github.com/juggernaut/netty-websocket-broadcast-exam...

Re:Jodd – The Unbearable Lightness of Java by winrid on Monday January 17, 2022 @10:41PM (#29974809)
Not using websockets, but thanks! I have to look into it again. Right now the service is working fine so I haven't been motivated to work on it again. (in-memory CDN based on vertx-web + Caffeine + custom on-disk LRU cache)
Re:Jodd – The Unbearable Lightness of Java by mycall on Monday January 17, 2022 @10:02PM (#29974514)
> zero-copy capable byte buffer

This is similar to .NET Standard 2.1 Span<T>?