-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
lang: remove space
inference via derive(Default)
#1563
Comments
Neither of these things seem like sufficient reason to remove space inference from
Is this being replaced by any way to manually call this? Or some other way to simplify the calculation of how much space is needed. Like should we start adding (this comment is probably coming too late but thought it worth responding anyway) |
agree that this is not a big deal but
this is. we want anchor to be as much of a zero-cost abstraction framework as possible and serializing an entire type at runtime just to get its static length is definitely far from that.
One thing Ive thought about is a |
Just how inefficient is it? There's quite a bit of mental overhead to calculating the size of different accounts and then keeping them up to date. It's sort of the equivalent of how comments and their underlying code sometimes stray from each other. That said, I like that there's discussion of alternative solutions and I will comment there too. Thanks for listening! |
Also, this seems to me to be a tool. If you need the efficiency then use space, if you do not care and want the quality of life then use Default. |
pre txwide compute unit changes I wouldve agreed but now the efficiency of your instruction affects the efficiency of the entire transaction. Therefore, all instructions should be as efficient as possible. But if you still want to use default to calculate the size, you can do it manually still |
Default::default
and thenlen
)The text was updated successfully, but these errors were encountered: