3 ms·
Comparing C# (.NET 5) with Rust would perhaps be interesting since at least then it’s languages on the same footing wrt heap allocating Option<> (neither does).
by alkonaut 5y ago
Comparing C# (.NET 5) with Rust would perhaps be interesting since at least then it’s languages on the same footing wrt heap allocating Option<> (neither does). But on the other hand then it should mostly be equal for a microbenchmark and that’s not very interesting.
Allocating anything like a “Long” or “Optional” on the heap seems like an extremely bad idea. Even if allocation and GC is almost free, the pointer chasing might not be.
- munchler 5y agoI would throw F# into that test as well.