-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Description
In a lot of rust code, I see "".to_string()
being used as the default method of creating a new string. This would normally be fine, but it's actually noticeably slower than String::new()
because it goes through the formatting infrastructure.
It'd be nice if this pattern could be special-cased in String::to_string
's implementation, or the optimizer made to do this transformation better.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.