You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been playing around with flux and noticed that the generated code had checks for safe std::variant access, even though the logic ensures that it was safe. I've identified a few places in the code, but there are more patterns like this: igrekster@70ef410
Wow, that's a huge improvement! And it's always nice to know when we generate better code than Rust iterators :)
It's a similar story with GCC: with your changes the example optimises down to an astonishingly small amount of assembly https://godbolt.org/z/c1dexE4Y9.
I'd be very happy to take a PR that implements this optimisation (here and in other places if you find more). I'd prefer not to require C++23 yet on GCC and Clang, but adding our own version of std::unreachableshouldn't be too difficult.
Unfortunately, I don't have much capacity ATM, but I might look into it some time in the next few weeks. Just wanted to bring attention to this optimization.
Been playing around with
flux
and noticed that the generated code had checks for safestd::variant
access, even though the logic ensures that it was safe. I've identified a few places in the code, but there are more patterns like this: igrekster@70ef410Here is before/after on the Compiler Explorer: https://godbolt.org/z/azfqMbT5j
And a Rust equivalent to compare: https://rust.compiler-explorer.com/z/K6E5xYc3W
The text was updated successfully, but these errors were encountered: