register_component
/ register_resource
calls cause noticeable growth in compile time
#643
Labels
register_component
/ register_resource
calls cause noticeable growth in compile time
#643
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: