]> Cypherpunks repositories - gostls13.git/commit
runtime: use doubly-linked lists for channel send/recv queues.
authorKeith Randall <khr@golang.org>
Mon, 8 Dec 2014 18:11:08 +0000 (10:11 -0800)
committerKeith Randall <khr@golang.org>
Mon, 8 Dec 2014 19:20:12 +0000 (19:20 +0000)
commit8eb8b40a4965c0bd5f96dfdfc5b037925f630c2d
treee75d583cbdb939d973d7237c4c1a5163af031d80
parent006ceb2f1dd64e75134347ae9a73be397ff8a2ed
runtime: use doubly-linked lists for channel send/recv queues.

Avoids a potential O(n^2) performance problem when dequeueing
from very popular channels.

benchmark                old ns/op     new ns/op     delta
BenchmarkChanPopular     2563782       627201        -75.54%

Change-Id: I231aaeafea0ecd93d27b268a0b2128530df3ddd6
Reviewed-on: https://go-review.googlesource.com/1200
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/gc/select.c
src/runtime/chan.go
src/runtime/chan_test.go
src/runtime/select.go