Skip to content
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

Wasm runtime compilation is largely single-threaded #2636

Open
2 tasks done
nazar-pc opened this issue Dec 6, 2023 · 8 comments
Open
2 tasks done

Wasm runtime compilation is largely single-threaded #2636

nazar-pc opened this issue Dec 6, 2023 · 8 comments
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Dec 6, 2023

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

I was recompiling things on Windows many times last few days and noticed that wasm runtime build script only uses a single CPU core for some reason, slowing things down significantly.

I'm not sure why this happens, but I don't think I have seen this behavior on Linux.

This is not a priority, but maybe someone knows why this happens and can point me in the direction that will help to resolve this.

Steps to reproduce

No response

@nazar-pc nazar-pc added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 6, 2023
@bkchr
Copy link
Member

bkchr commented Dec 6, 2023

What profile did you use? Release?

@nazar-pc
Copy link
Contributor Author

nazar-pc commented Dec 6, 2023

Yes, standard release profile

@nazar-pc nazar-pc changed the title Wasm runtime compilation is single-threaded on Windows Wasm runtime compilation is largely single-threaded Aug 29, 2024
@nazar-pc
Copy link
Contributor Author

Clarification: it is largely single-threaded even on Linux

@bkchr
Copy link
Member

bkchr commented Aug 30, 2024

#4946 there was this pr recently to ensure we are not overloading the system.

@nazar-pc
Copy link
Contributor Author

Well, it is massively under-utilizing my system instead. On 32C64T system seeing single remaining WASM runtime blocking other crates from being compiled while using a single CPU core is a frustrating experience. It is the most pronounced for polkadot-sdk contributions where there are many crates including numerous runtimes to compile.

@bkchr
Copy link
Member

bkchr commented Aug 30, 2024

On 32C64T system seeing single remaining WASM runtime blocking other crates from being compiled while using a single CPU core is a frustrating experience

Ahh now I get what you mean. These are basically pipeline blockers, forcing the compiler to wait on them to compile. When it comes to linking, compression etc it will not use multiple CPUs anymore.

@bkchr
Copy link
Member

bkchr commented Aug 30, 2024

Not sure we can do that much. I mean we can probably move some crates around, but in the grand scheme I doubt that it will change something.

@nazar-pc
Copy link
Contributor Author

I understand fundamental constraints of linking and such, but build script of runtimes takes incomparably large amount of time for some reason, there must be some low-hanging fruits there. Compiling native runtime takes a small fraction of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants