Skip to content

Conversation

yoshuawuyts
Copy link
Contributor

Entirely for fun, but sets us up against std and parking_lot mutexes, which will soon be the same thing. Figured it'd be nice to remind us of the baseline we're measuring against while benchmarking. Because it doesn't seem like perf will fluctuate much there.

Thanks!

Sample Output

test async_std::contention      ... bench:     342,769 ns/iter (+/- 59,938)
test async_std::create          ... bench:           5 ns/iter (+/- 0)
test async_std::no_contention   ... bench:     576,119 ns/iter (+/- 9,641)
test parking_lot::contention    ... bench:     257,292 ns/iter (+/- 66,530)
test parking_lot::create        ... bench:           0 ns/iter (+/- 0)
test parking_lot::no_contention ... bench:     342,655 ns/iter (+/- 23,643)
test std::contention            ... bench:   1,560,041 ns/iter (+/- 733,017)
test std::create                ... bench:          24 ns/iter (+/- 1)
test std::no_contention         ... bench:     339,644 ns/iter (+/- 39,173)
test result: ok. 0 passed; 0 failed; 0 ignored; 9 measured; 0 filtered out

note that "no contention" is never faster than "contention" because we're running 10x the amount of tasks. They cannot quite be compared (:

Signed-off-by: Yoshua Wuyts <[email protected]>
@yoshuawuyts yoshuawuyts added this to the 1.1.0 milestone Nov 20, 2019
@c410-f3r
Copy link

c410-f3r commented Dec 6, 2019

Maybe also add futures::lock::Mutex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants