-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
standard library results in enormous binaries #12199
Copy link
Copy link
Closed
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.metabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")
Metadata
Metadata
Assignees
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.metabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")
Type
Fields
Give feedbackNo fields configured for issues without a type.
The initial binary size in C is ~3-8K, while Rust binaries using the standard library start at 2MiB. This problem doesn't stop with the initial code size and continues to grow at a rate much faster than C or C++ applications performing the same work. This is not a Rust compiler issue as it doesn't occur when not using the standard library, even when using an API at the same level of abstraction.
Rust is linking dynamically against the system libraries so there's really no excuse for them being this large. The code size needs to be in the same ballpark as C++ (at most 2x or 3x as large...).