Fork me on GitHub
#aleph
<
2022-11-22
>
Eugen22:11:29

would it be hard to try aleph on virtual thread? I heard / read in a few places that it is comparable to native performance. https://medium.com/@zakgof/a-simple-benchmark-for-jdk-project-looms-virtual-threads-4f43ef8aeb1

valerauko02:11:07

my naive and unresearched opinion is that if you can get a virtual thread executor and give it to aleph, you can try it

Matthew Davidson (kingmob)04:11:31

We've been playing around with it, and I've started work on a Manifold-compatible successor that uses vthreads, but off the top of my head, I'm not sure how much higher performance we could expect to see in Aleph, from switching over immediately. Part of the underlying machinery is based off Netty, which is entirely event-driven off platform threads at the moment. An https://github.com/netty/netty/issues/12348 wasn't promising, but there's more to look into, to make netty take advantage of vthreads. It's not a simple drop-in, unfortunately, since things like ThreadLocal caches will hurt performance in a vthread world, if copied rampantly. Ultimately, though, the event-driven paradigm doesn't make much sense if vthreads are super-cheap. It's a shame https://github.com/puniverse/pulsar died out (one of the Pulsar authors went on to work on Loom); it was the first clj lib built for fibers. For now, you can partially try it out by redefining the wait-pool and executor-pool in manifold.executor to use the new vthread executor. Let us know what you find.

Eugen12:11:35

thanks, I hope I find some time to play with this

Matthew Davidson (kingmob)04:11:31

We've been playing around with it, and I've started work on a Manifold-compatible successor that uses vthreads, but off the top of my head, I'm not sure how much higher performance we could expect to see in Aleph, from switching over immediately. Part of the underlying machinery is based off Netty, which is entirely event-driven off platform threads at the moment. An https://github.com/netty/netty/issues/12348 wasn't promising, but there's more to look into, to make netty take advantage of vthreads. It's not a simple drop-in, unfortunately, since things like ThreadLocal caches will hurt performance in a vthread world, if copied rampantly. Ultimately, though, the event-driven paradigm doesn't make much sense if vthreads are super-cheap. It's a shame https://github.com/puniverse/pulsar died out (one of the Pulsar authors went on to work on Loom); it was the first clj lib built for fibers. For now, you can partially try it out by redefining the wait-pool and executor-pool in manifold.executor to use the new vthread executor. Let us know what you find.