-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider boxing errors more #2251
Comments
I agree we should box errors on our end, for sure. |
I think |
Indeed that is what I was referring to as well, to be clear. Even then |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clippy complains about my error enums based on Vulkano error types because they are very large (>= 160 bytes), and thus make Results very expensive to move around if the memcpy is not elided.
I think this is a valid performance concern from clippy's side, as I've observed my fair share of failed move optimizations from rustc/LLVM, and the performance impact that comes with them can indeed be quite significant.
On the other hand, I am also well aware that error boxing come with a large ergonomic hit. Among other things, it reduces ability to pattern match error types, adds annoying Box::new() everywhere, and if applied on the client side it breaks use of
?
unless you write all theFrom<NotBoxedError>
impls yourself. The latter is an argument in favor of implementing boxing on the side of the code that throws errors, if it is to be implemented at all.Overall, I'm a bit torn here, and could use extra opinions from other people. Are you fine with the performance risks of having large results, or would you rather have vulkano do the right thing from the performance PoV even if it comes at some ergonomic cost (and a major error API break if done today)?
The text was updated successfully, but these errors were encountered: