-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
register_component
/ register_resource
calls cause noticeable growth in compile time
#643
Labels
Comments
Yes a big amount of code is currently being generated upon registration! I think it's possible to cut down this by type-erasing some of the systems (message replication, prediction, interpolation), similar to what is done with replication |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was investigating why our protocol crate was so slow to build, and narrowed it down to
register_component
/register_resource
. To reproduce this, I createdcompiletime_test
as an example inexamples
:examples/compiletime_test/Cargo.toml
:examples/compiletime_test/src/main.rs
:and then rebuilt it with the following command to ensure the dependencies remained built, but the binary itself was being built from scratch:
Here's the data I collected:
register_component
register_component
Plotted, just for the fun of it:
This is also true of
register_resource
. I tested withas the body of the macro, and found the following (didn't test all of the cases):
register_resource
register_resource
My suspicion is that this is due to monomorphisation generating junk code, but I haven't been able to confirm that yet.
The text was updated successfully, but these errors were encountered: