The text on concatenation highlights that s1 + &s2 is efficient because it does only 1 copy. But, as a side effect s1 is consumed and cannot be used later.
Whereas, format!("{} {}", s1, s2) doesn't takes ownership of s1 and s2. But, does that mean that now there are 2 copies and it is less efficient than s1 + &s2?
Technically speaking, yes. However, usually realloc (which is called when extending a Vec or String) is usually implemented by means of allocating space, copying old space, and freeing old space, which reduces impact of this. jemalloc does have some optimizations, but they require pretty specific conditions to trigger. format! macro for about 4 months allocates with capacity, so it isn't as slow as it used to be.
Essentially, don't be too concerned about which one you use. Use whatever is better for your use case, don't micro optimise (unless you found with profilling that you need to optimize that part of code).
test concat ... bench: 15,345 ns/iter (+/- 782)
test format ... bench: 15,581 ns/iter (+/- 1,564)
The benchmarks in this case are inconclusive, and don't really say which one is faster.
(a string tested was 65536 bytes long, so 15000 ns is about what was expected when simply copying data four times, I think there was barely any overhead, just simply copying what needed to be copied)
Thanks @xfix. append would typically use realloc, and I missed that point. Both implementations would do one allocation and 2 copies unless there is extra capacity.