-
Notifications
You must be signed in to change notification settings - Fork 446
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
Optimized decode of AccountId #1016
Conversation
Can you tell us the effect on some examples for this? It would be interesting to know why the default is so bad here. Also we could apply this to Hash and Key types as well. |
Yea, sorry. thought that Before change: After change: |
Codecov Report
@@ Coverage Diff @@
## master #1016 +/- ##
===========================================
- Coverage 75.37% 63.78% -11.59%
===========================================
Files 246 246
Lines 9258 9267 +9
===========================================
- Hits 6978 5911 -1067
- Misses 2280 3356 +1076
Continue to review full report at Codecov.
|
We'll merge paritytech/ink-waterfall#16 hopefully today, then it will :-). |
How to trigger the report?=) |
🦑 📈 ink! Example Contracts ‒ Size Change Report 📉 🦑These are the results of building the
Link to the run | Last update: Tue Nov 16 17:09:38 CET 2021 |
We just merged the PR, it's triggered automatically now with every run of the |
@xgreenx Btw. the above report already includes the changes you made in use-ink/cargo-contract#358. |
Last stage... Maybe it is possible to run manually for some PR(for example #1017 )?=D |
Not trivially, I guess it's the reward you get once you've fixed all the CI stages before it ;-). But is there anything preventing you from fixing the CI stages at that PR? |
I'm not sure about the final state of the code, so I'm waiting for some input from you and @Robbepop=) Because it requires removing some logic added before and maybe you have your vision of the code. I described the main idea and results that I got=) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it strange that the Decode derive impl and the impls provided by this PR are not optimized to same or similar IR. It would be nice to know why. Some guesses: Special treatment for Copy types, no guaranteed RVO, no guaranteed copy elision etc.
I agree that better to do a fix for the general case. But it means that general implementation will be not so general because it requires some restrictions like |
If MaybeUninit is used no further restrictions need to be put in place. There are some crates for safe and efficient array initialization. |
I will try it. If everything is okay, then I will create a pull request=) BTW, if it is not hard then it's strange why it is not implemented from the beginning) |
@Robbepop I implemented idea with But a native implementation(from this PR) still is better=) Original wasm size: 33.5K, Optimized: 10.2K(10163) If you agree to use usable feature(like negative-impls or specialization), we can specify the implementation for |
This change is implemented on |
Default decode takes ~300 bytes