-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace mempool with thread_local #200
Conversation
@Amanieu So, one of my concerns (that I didn't realize before when looking at
My thoughts on (1) is that the big dependencies are as close to fundamental as we can get in the ecosystem, so they are probably already present in a lot of projects. Does that mean we should be OK with them getting pulled in by I'm not sure about (2). I don't think we've really ironed out a policy here regarding the minimum level of support for the |
@Amanieu Thanks for doing this by the way! You beat me to it. :-) |
I'm personally a fan of minimizing dependencies (e.g. a crate like |
Oh right, and for minimum Rust version, I still have yet to hear of anyone requiring an older stable release, so requiring 1.6 should be fine. We don't have a policy yet for rust-lang-nursery crates for either version compatibility or dependency lists, so doing the "most reasonable thing" for now should be fine :) |
All right, I went ahead and merged this in 2cda56e (after rebasing on to master). I'm still bummed about the added dependencies, but @alexcrichton has a point---we're kind of already hosed there anyway. As far as benchmarks go, it looks like you're right about it improving the single threaded case, if only by a tiny bit. Here's the comparison:
I suspect some of this is noise, but I also suspect there was some actual improvement. Also, in my (currently hand run) Of course, we aren't observing the (theoretically) biggest wins here since I don't yet have any multithreaded benchmarks that would measure the impact of contention. In any case, thanks very much! |
This should result in a slight performance improvement for single-threaded code because it uses native thread IDs instead of TLS. It should also significantly improve performance with multiple threads since it no longer uses a mutex (35ns vs 5ns).