-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Optimize calls for utility and lottery #9339
Changes from all commits
4f63cb0
6603341
f8ed16e
ec93539
0510139
8bc21dd
5a93791
40f6df7
ee9aabf
2832e55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,7 +149,7 @@ pub mod pallet { | |
| })] | ||
| pub fn batch( | ||
| origin: OriginFor<T>, | ||
| calls: Vec<<T as Config>::Call>, | ||
| calls: Vec<Box<<T as Config>::Call>>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't make any sense. When you use a Vec, these values are already "boxed". What you want to achieve here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inside a vec, the array of element is boxed, not each element individually.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that is right, but what is the reason for doing this? We will not have a call vec with 83886 calls anyway? |
||
| ) -> DispatchResultWithPostInfo { | ||
| let is_root = ensure_root(origin.clone()).is_ok(); | ||
| let calls_len = calls.len(); | ||
|
|
@@ -256,7 +256,7 @@ pub mod pallet { | |
| #[transactional] | ||
| pub fn batch_all( | ||
| origin: OriginFor<T>, | ||
| calls: Vec<<T as Config>::Call>, | ||
| calls: Vec<Box<<T as Config>::Call>>, | ||
| ) -> DispatchResultWithPostInfo { | ||
| let is_root = ensure_root(origin.clone()).is_ok(); | ||
| let calls_len = calls.len(); | ||
|
|
||
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.
This seems to be the difference with encoding? Double the weight per call
Uh oh!
There was an error while loading. Please reload this page.
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.
we can't say for sure until we compare with the benchmark with the decoding but without the Box, but anyway this seems ok to mecomparing to the benchmark result in this PR #9343 it is indeed from the difference in decoding.