-
Notifications
You must be signed in to change notification settings - Fork 842
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
Use uint packing instead of structs #272
Conversation
3597937
to
67979b0
Compare
~ just an idea: |
I think it's still okay to directly write the bitwise ops inline to have a little more control. |
7be400d
to
1dcd84a
Compare
1dcd84a
to
8f78a35
Compare
8f78a35
to
9f519d7
Compare
Let's do one more poll to see how people feel about this |
This PR is made in preparation for #267.
This is a breaking change, as the internal
_ownerships
mapping is renamed to_packedOwnerships
.Using uints allow us to write most of the packing logic in Solidity instead of assembly. This allows us to keep the code compatible with the diamonds transpiler we are planning to use in the near future. Also, it is easier to read, and surprisingly more performant.
This PR is inspired by and includes #270. I’ve tried the idea with structs: it added quite a bit of overhead because of the many values that are often needlessly unpacked by the compiler. Manual unpacking allows us to achieve a much lower overhead.
Additional tests have been added to ensure that the
startTimestamp
s are packed / unpacked properly.Before:
After: