-
Notifications
You must be signed in to change notification settings - Fork 262
fix clippy slow_vector_initialization #618
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
Should be smaller codegen size
Ahh, this should affect |
Why CI ignores changes in workflow? idk. |
1eb5e0e
to
9234bc7
Compare
@@ -409,8 +409,7 @@ pub fn init() -> Result<Init, ()> { | |||
// | |||
// See https://learn.microsoft.com/cpp/build/reference/pdbpath for an | |||
// example of where symbols are usually searched for. | |||
let mut search_path_buf = Vec::new(); | |||
search_path_buf.resize(1024, 0); | |||
let mut search_path_buf = vec![0; 1024]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. This could be with_capacity
, and then we pass the search_path_buf.capacity()
when indicating how much space we have to allocate, and then we pass a search_path_buf.set_len
after filling it.
...or that could be over-optimization as we are likely to get a fresh raw page from the OS because this was a calloc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fresh pages from the OS may still be more expensive than a recycled allocation from a pooling allocator. But I'd only play those kinds of games if this shows up in a benchmark and not just clippy linting about it.
Code size changes for a hello-world Rust program linked with libstd with backtrace: On platform
|
@klensy apparently needs imports? |
Code size changes for a hello-world Rust program linked with libstd with backtrace: On platform
|
9234bc7
to
aa95934
Compare
https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md Looks like upload-artifact should be bumped too |
It was in ... Oh we bumped download not upload. |
Should be smaller code size