-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Optimization] Speed-up boot time #5519
Comments
in this case Make sure the chain spec is raw to save time there too. |
Yes @shawntabrizi , it takes longer with the chain specs (I think reading/parsing the json is longer than from binary)
|
IIRC most of that time is spent compiling the current runtime WASM code. That's why it scales well with the number of CPUs. |
Thank you @arkpar this is a huge difference yes:
With
|
@arkpar how stable is it to use interpreted wasm ? |
How stable is what? :P The node? Interpreted should always work and be more "stable" than compiled. |
@bkchr "Stable" in the sense of being consistent with compiled wasm ? We know that "native" for exemple doesn't always provide the same result as the compiled wasm. I'm wondering if the interpreter is in the same case, or is it considered to provide always the same output as the compiled one :) |
@arkpar also, isn't it possible to provide a system to pre-compile the wasm (into a file) to be loaded directly by the binary ? |
As I already said, interpreted is "more correct". So, yes, it should always provide the same results. |
Please no :P I mean wasmtime supports this and we somehow also support this, but currently not for "node runtimes". |
@bkchr I see. Are you afraid this would lead to more issues with inconsistent runtime overall (wrong file, wrong version, wrong compilation) ? |
I'm more afraid of adding features for niche use cases. ;) |
Sounds good :) |
on-disk WASM compilation cache is something we considered for POV/parachain code. But I'm not sure what's the status of it. CC @pepyakin |
This is done in multiple flavors. Now PVF host executor implements its own cache. Previously, we used the cache provided by wasmtime. It's possible enable it by passing the |
Is there a way to use it for the relay chain runtime in substrate as well? |
For the former, no 1. For the latter, yes: the client should just specify Footnotes
|
Starting the polkadot node (also it is the same for parachains) takes 20 cpu-seconds which is quite a lot for some cases.
With a high-end CPU, it takes ~3s which is fine for humans. However for automated CI requiring to launch 500-1000 times a node, it adds up quickly.
If you have any suggestion to improve this, that would be great :)
(cc @rphmeier )
The text was updated successfully, but these errors were encountered: