Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

remote-externalities: batch insert key/values #14004

Merged
merged 5 commits into from
Apr 27, 2023

Conversation

liamaharon
Copy link
Contributor

@liamaharon liamaharon commented Apr 25, 2023

As suggested by @arkpar (#13562 (comment)), adds batch inserting of key/value pairs to remote-externalities so the trie root doesn't need to be re-computed after every insertion.

some (totally unscientific) try-runtime benchmarks

at ws://localhost:9944 is an (optimised build) kusama node

Task Build Before After Improvement
on-runtime-upgrade (live) release 72s 59s 18%
on-runtime-upgrade (live) debug 174s 73s 58%
create-snapshot release 70s 58s 17%
create-snapshot debug 173s 57s 67%
on-runtime-upgrade (snap) release 21s 5s 76%
on-runtime-upgrade (snap) debug 125s 19s 84%

@liamaharon liamaharon added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Apr 25, 2023
utils/frame/remote-externalities/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@liamaharon liamaharon merged commit dce73fe into master Apr 27, 2023
@liamaharon liamaharon deleted the liam-remote-externalities-batch-insert branch April 27, 2023 08:12
crystalin pushed a commit to moonbeam-foundation/substrate that referenced this pull request May 3, 2023
* add batch inserting into remote externalities

* use into_iter

* remove redundant comment

* redundant batch insert

* avoid extra vec allocations
gpestana pushed a commit that referenced this pull request May 4, 2023
* add batch inserting into remote externalities

* use into_iter

* remove redundant comment

* redundant batch insert

* avoid extra vec allocations
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* add batch inserting into remote externalities

* use into_iter

* remove redundant comment

* redundant batch insert

* avoid extra vec allocations
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants