bors
47c9a35747
auto merge of #10830 : alexcrichton/rust/spsc-queue, r=brson
...
This pull request completely rewrites std::comm and all associated users. Some major bullet points
* Everything now works natively
* oneshots have been removed
* shared ports have been removed
* try_recv no longer blocks (recv_opt blocks)
* constructors are now Chan::new and SharedChan::new
* failure is propagated on send
* stream channels are 3x faster
I have acquired the following measurements on this patch. I compared against Go, but remember that Go's channels are fundamentally different than ours in that sends are by-default blocking. This means that it's not really a totally fair comparison, but it's good to see ballpark numbers for anyway
```
oneshot stream shared1
std 2.111 3.073 1.730
my 6.639 1.037 1.238
native 5.748 1.017 1.250
go8 1.774 3.575 2.948
go8-inf slow 0.837 1.376
go8-128 4.832 1.430 1.504
go1 1.528 1.439 1.251
go2 1.753 3.845 3.166
```
I had three benchmarks:
* oneshot - N times, create a "oneshot channel", send on it, then receive on it (no task spawning)
* stream - N times, send from one task to another task, wait for both to complete
* shared1 - create N threads, each of which sends M times, and a port receives N*M times.
The rows are as follows:
* `std` - the current libstd implementation (before this pull request)
* `my` - this pull request's implementation (in M:N mode)
* `native` - this pull request's implementation (in 1:1 mode)
* `goN` - go's implementation with GOMAXPROCS=N. The only relevant value is 8 (I had 8 cores on this machine)
* `goN-X` - go's implementation where the channels in question were created with buffers of size `X` to behave more similarly to rust's channels.
2013-12-17 01:16:43 -08:00
..
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-12-12 00:49:57 -08:00
2013-07-02 01:05:57 +05:30
2013-11-30 15:47:43 -08:00
2013-12-16 17:47:11 -08:00
2013-12-10 14:05:57 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:25:27 -08:00
2013-12-11 06:40:37 -05:00
2013-12-11 06:40:37 -05:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-12-12 00:49:57 -08:00
2013-12-12 00:49:57 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-12-03 17:26:51 -05:00
2013-12-12 00:49:57 -08:00
2013-11-26 08:25:27 -08:00
2013-12-16 17:47:11 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 14:06:52 +09:00
2013-11-26 08:20:59 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-10 17:04:24 -07:00
2013-12-10 17:04:24 -07:00
2013-11-26 08:25:27 -08:00
2013-10-23 18:06:12 -04:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-27 09:54:30 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-08 02:55:27 -05:00
2013-05-28 20:22:14 -04:00
2013-12-11 10:54:06 -08:00
2013-05-22 21:57:10 -07:00
2013-12-12 00:49:57 -08:00
2013-11-26 08:20:58 -08:00
2013-11-26 08:20:58 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:19:00 -08:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-11-26 08:19:00 -08:00
2013-12-02 14:20:27 -08:00
2013-12-06 01:39:32 -05:00
2013-08-26 15:50:52 +02:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-12-11 10:54:06 -08:00
2013-12-16 22:38:02 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-10 01:17:32 +09:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-16 02:15:00 -05:00
2013-12-08 02:55:27 -05:00
2013-12-14 00:35:41 -05:00
2013-12-14 22:56:33 -08:00
2013-12-08 02:55:27 -05:00
2013-11-26 13:24:11 +09:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-11-26 14:07:48 +09:00
2013-11-27 09:54:30 -08:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-08 02:55:27 -05:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-10-22 08:09:56 -07:00
2013-11-26 13:56:02 -08:00
2013-12-08 02:55:27 -05:00
2013-08-07 22:07:24 +04:00
2013-11-28 20:27:56 -08:00
2013-11-28 20:27:56 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:25:27 -08:00
2013-12-12 00:49:57 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:25:27 -08:00
2013-12-10 15:13:12 -08:00
2013-12-10 15:13:12 -08:00
2013-12-03 14:31:54 -08:00
2013-12-12 00:49:57 -08:00
2013-12-12 00:49:57 -08:00
2013-11-26 08:19:00 -08:00
2013-12-03 20:40:38 -08:00
2013-12-03 20:40:38 -08:00
2013-12-03 20:40:38 -08:00
2013-11-26 08:20:59 -08:00
2012-12-10 17:32:58 -08:00
2013-11-30 15:47:43 -08:00
2013-11-11 21:53:14 +09:00
2013-11-28 20:27:56 -08:00
2013-12-09 22:53:58 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:25:27 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-15 10:41:15 -08:00
2013-11-26 08:25:27 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-28 06:43:39 -05:00
2013-11-28 06:43:39 -05:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-11 10:54:06 -08:00
2013-12-15 10:41:15 -08:00
2013-12-08 02:55:27 -05:00
2013-12-08 02:55:27 -05:00
2013-11-17 18:35:52 -05:00
2013-12-12 00:49:57 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-11-26 08:25:27 -08:00
2013-05-18 00:26:04 +02:00
2013-10-23 18:06:12 -04:00
2013-05-03 20:01:42 -04:00
2013-11-26 08:19:00 -08:00
2013-12-11 10:54:06 -08:00
2013-12-12 00:49:57 -08:00
2013-12-16 17:47:11 -08:00
2013-05-30 21:41:41 -04:00
2013-12-10 17:04:24 -07:00
2013-12-10 17:04:24 -07:00
2013-12-14 00:35:41 -05:00