2026-04-17 04:43 UTC
@folkertdev Possibly, yeah. I think an indirect branch is more suitable here because 1) it is prediction friendly (we always reach exactly the same address, every time except the first, and CPUs have been good at that for a while); 2) it scales better than conditional branches; 3) it allows for dynamically loading the code at runtime (multiversioning as a language feature should not do this, but it is an avenue I'm curious to explore).
I had forgotten about the multiversion crate; I'm going to try using it again and make sure the user experience is where I want it. I think its #[inherit_target] only works when declared inside the original function; this limitation could be resolved if this was a built-in attr. And it doesn't help parameterizing types over the feature set (which is a bit more niche, but I find myself reaching for it often).
Replies (0)
No replies.