fix clippy slow_vector_initialization#618
Conversation
Should be smaller codegen size
|
Ahh, this should affect |
|
Why CI ignores changes in workflow? idk. |
1eb5e0e to
9234bc7
Compare
| // 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.
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.
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