You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i think this may be impossible to fix without changing Self::Item: Display bound into something else or waiting for specialization. Current implementation has no choice but to either use .to_string() (which has some specializations, but at the same will pretty much always box the values unless they are already a String) or write! (which involves dynamic dispatch and going through a lot of fmt internals) - neither of those is a particularly great choice.
I don't have benchmarks to test it, but I'm somewhat curious how .intersperse(sep).collect::<String>() compares in terms of performance.
Looking at the code for .intersperse it is much more complicated with two if statements. This is much more complicated than the other code. The other one pulls the if statement out of the loop and then goes though the rest. This would allow for loop optimization and really good pipe-lining in a processor. Looking forward to the test.
If you replace:
iterable.into_iter().join(sep)
With
in Itertools::join the performance is 2X faster.
The text was updated successfully, but these errors were encountered: