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

Execution optimisation #257

Closed
arkpar opened this issue Jun 27, 2018 · 3 comments
Closed

Execution optimisation #257

arkpar opened this issue Jun 27, 2018 · 3 comments
Assignees
Labels
I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. Z3-substantial Can be fixed by an experienced coder with a working knowledge of the codebase.
Milestone

Comments

@arkpar
Copy link
Member

arkpar commented Jun 27, 2018

Execution stack is currently suboptimal. Each call involves querying code from storage, getting runtime version, initialising wasm module, etc. A bulk of work should only be done once per code change. There should be a module between state and executor that tracks code changes and caches reusable bits for each state. If the state does not have code changed since the last state it should reuse cached data for the new state.

Related: #238

@arkpar arkpar added I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. Z3-substantial Can be fixed by an experienced coder with a working knowledge of the codebase. labels Jun 27, 2018
@pepyakin

This comment has been minimized.

gnunicorn added a commit to gnunicorn/polkadot that referenced this issue Jul 2, 2018
gnunicorn added a commit to gnunicorn/polkadot that referenced this issue Jul 3, 2018
Cache whether the native or wasm runtime should be used for a given
code and if the latter, keep around the parsed wasmi::Module for faster
execution.

Refs paritytech#257, paritytech#275
@gnunicorn
Copy link
Contributor

@arkpar anything else you wanted to have addressed, that not in #276 and #283 already?

@arkpar
Copy link
Member Author

arkpar commented Jul 9, 2018

The code is still queried from the database for each call. As the description suggests the cache should track code changes. If the code does not change when transitioning from state A to B it should not be queried when making calls on B. The code cache needs to be tied to the state root and if there was no code change it should just reuse the cache from the parent state.

@gavofyork gavofyork added this to the 1.0 milestone Sep 5, 2018
@arkpar arkpar self-assigned this Sep 25, 2018
@gavofyork gavofyork modified the milestones: 1.0 (final), 1.x series Dec 18, 2018
JoshOrndorff added a commit to moonbeam-foundation/substrate that referenced this issue Apr 21, 2021
* Updates embedded stagenet/alphanet

* format embedded specs

* Reduces blocks per round for testing

* Updates embedded chain

* Bump crate version to 0.6.0

* Add default parachain telemetry endpoint (paritytech#257)

* Restore blocksPerRound to 600

* Updates embedded specs

Co-authored-by: Joshy Orndorff <admin@joshyorndorff.com>
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
liuchengxu pushed a commit to chainx-org/substrate that referenced this issue Aug 23, 2021
helin6 pushed a commit to boolnetwork/substrate that referenced this issue Jul 25, 2023
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. Z3-substantial Can be fixed by an experienced coder with a working knowledge of the codebase.
Projects
None yet
Development

No branches or pull requests

4 participants