about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/alloc_example.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-17 15:38:33 +0000
committerbors <bors@rust-lang.org>2023-07-17 15:38:33 +0000
commit410456da51262c5ecc57554ea6007327cb8328e9 (patch)
tree051ccfbeb9f6595eba3cc2367d8ddcc516456de0 /compiler/rustc_codegen_gcc/example/alloc_example.rs
parent54fa92287b91ff16bb6001d816dd7ae19dc52f91 (diff)
parentc83d58f5076f3a79ea79514395a02babd15687b1 (diff)
downloadrust-410456da51262c5ecc57554ea6007327cb8328e9.tar.gz
rust-410456da51262c5ecc57554ea6007327cb8328e9.zip
Auto merge of #11116 - y21:format_collect, r=Manishearth
new lint: `format_collect`

A perf lint that looks for `format!`ing inside of `map`, then collecting it into a `String`. Did a quick benchmark locally and it's a bit more than 2x faster with fold.
`write!` is still not optimal (presumably because the fmt stuff goes through dynamic dispatch), but it's still a lot better than creating a new string on every element.
I thought about making a machine applicable suggestion, but there's a lot of suggestions that need to be made here, so I decided to just add help messages.

changelog: new lint: `format_collect`
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs')
0 files changed, 0 insertions, 0 deletions