Closed Licenser closed 2 years ago
@Licenser Thanks so much for this great contribution! :+1: The actual changes look good to me, so I only have nitpicks about non-functional aspects. :) Apart from the comments on the commit:
Otherwise, looks really great.
:+1: split it out into two commits and added some additional text to them
+1 split it out into two commits and added some additional text to them
Awesome! That was quick. Just one more split and we're good to go. :)
Ohh, sorry I didn't understand what you meant, the changes on the Cargo.toml
were VSCode being eager :) I reverted them as I didn't mean to change the Cargo.toml
aside from the addition of benchmarks and the new dependency. Hope this looks good now
Many thanks @Licenser !
This removes the clone mentioned #18 for
try_recv
if we are the last receiver reading a message that would move the queue forward.It also adds two benchmarks (one sender, one receiver) and (one sender two receivers) to measure this. The benchmark is not perfect as it uses simple_features as well as a copy-able payload (the best possible case for the old code) the results were still encouraging.
For 1->1 it showed a 1% drop in performance for 1->2 it showed a 9% improvement in perforamcen
that seems worth it as we'll likely see much bigger improvements for more complex data structures that need to be cloned instead of copied.