about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc/mod.rs
diff options
context:
space:
mode:
authorJoshua Lockerman <j@Js-MacBook-Air.home>2017-09-29 15:58:11 -0400
committerJoshua Lockerman <j@Js-MacBook-Air.home>2017-10-01 12:15:35 -0400
commit68341a91eecb830c57779cd2423733a7395258ab (patch)
tree851726d9a606ab4ffd49b719f741dd856e09dfd1 /src/libstd/sync/mpsc/mod.rs
parent0e6f4cf51cd3b799fb057956f8e733d16605d09b (diff)
downloadrust-68341a91eecb830c57779cd2423733a7395258ab.tar.gz
rust-68341a91eecb830c57779cd2423733a7395258ab.zip
Improve performance of spsc_queue and stream.
This commit makes two main changes.
1. It switches the spsc_queue node caching strategy from keeping a shared
counter of the number of nodes in the cache to keeping a consumer only counter
of the number of node eligible to be cached.
2. It separate the consumer and producers fields of spsc_queue and stream into
a producer cache line and consumer cache line.
Diffstat (limited to 'src/libstd/sync/mpsc/mod.rs')
-rw-r--r--src/libstd/sync/mpsc/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index dcd4c8dfdf5..0bfbcd2d2cd 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -297,6 +297,8 @@ mod sync;
 mod mpsc_queue;
 mod spsc_queue;
 
+mod cache_aligned;
+
 /// The receiving half of Rust's [`channel`][] (or [`sync_channel`]) type.
 /// This half can only be owned by one thread.
 ///