Upgrading Rust's Standard Library

Channels

Channels can be a little bit of a hassle to use at times because they are not Sync. Of course, you can use sync_channel from the standard library instead, but you’ll then have to specify a bound.

crossbeam-channels are a nearly drop-in replacement, except they’re way faster, they support multiple receivers, and their Senders and Receivers are Send and Sync. Of course, there’s even more on top of that: read about them straight from the source.

Crossbeam itself has more tricks up its sleeve, check it out here.

HashMaps and HashSets

The standard library’s HashMaps (and HashSets) use SipHash in order to prevent HashDoS attacks. Much of the time though, you don’t need to protect against those attacks.

hashbrown allows you to use FxHash instead of SipHash, trading security for performance where allowable.

Mutex, RwLock, Condvar, and Once

For the other two crates, I tried to give a little bit of a backstory, but I don’t want to waste your time at all with this one reiterating what’s already written concisely on the main page of the docs:

parking-lot