News for hackers. Stuff that matters.
Re:Using Rust in Non-Rust Servers to Improve Performance by consteval on Wednesday October 30, 2024 @09:43AM (#41994644)
> Optimizer can also specialize functions and programmers can do too

Yes, but not if you pass in void *. For libraries this matters. If you're both writing the producer and consumer then sure, you can do it manually.

> code bloat caused by monomorphization

This is true and a real problem, but I would argue in most scenarios extra codegen will be more performant than dynamic allocation + redirection. Because that's the alternative, like how swift or C# or Java do it.

Re:Using Rust in Non-Rust Servers to Improve Performance by neonsunset on Wednesday October 30, 2024 @11:19AM (#41995940)
Java does not monomorphize, it has no true generics - it's objects all the way down. It does, however, perform guarded devirtualization since all methods are virtual by default, so performance lives and dies by OpenJDK hotspot emitting guarded for fast, often multiple, dispatch as well as optimizing "megamorphic" callsites with vtable-ish dispatch (which is about the default cost of interface dispatch in .NET, somewhat slower than virtual dispatch).
Re:Using Rust in Non-Rust Servers to Improve Performance by consteval on Wednesday October 30, 2024 @04:14PM (#41999711)
Very interesting, thanks for sharing. Always neat to look into the inner workings of JVM implementations.
Re:Using Rust in Non-Rust Servers to Improve Performance by uecker on Friday November 01, 2024 @05:51AM (#42015391)
Of course it also works with void*.