u/Zeta0114942in r/rust • Recommends
On “Why is std::sync::Mutex 60-70x time slower than C++'s std::mutex?”
As I remember it from a great talk by Mara Bos, posix mutexes aren't allowed to be moved, so they are wrapped inside the a `Pin<Box<OsMutex>>`, which necessitates a heap allocation per mutex.
To negate this difference i would recommend using `parking_lot` mutex or trying to compile cpp code in msvc, since on windows Mara just changed the doc to allow moves (see in the talk).