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

runtime: fine-grained locking in select #8896

Open
dvyukov opened this Issue Oct 7, 2014 · 10 comments

Comments

Projects
None yet
7 participants
@dvyukov
Member

dvyukov commented Oct 7, 2014

Fine-grained locking in select provides substantial speedups:

benchmark                            old ns/op     new ns/op     delta
BenchmarkSelectUncontended           213           188           -11.74%
BenchmarkSelectUncontended-2         110           97.2          -11.64%
BenchmarkSelectUncontended-4         56.2          49.5          -11.92%
BenchmarkSelectUncontended-8         29.7          25.9          -12.79%
BenchmarkSelectUncontended-16        17.3          16.4          -5.20%
BenchmarkSelectUncontended-32        13.7          11.4          -16.79%
BenchmarkSelectSyncContended         795           710           -10.69%
BenchmarkSelectSyncContended-2       946           710           -24.95%
BenchmarkSelectSyncContended-4       1791          1187          -33.72%
BenchmarkSelectSyncContended-8       1749          637           -63.58%
BenchmarkSelectSyncContended-16      2109          563           -73.30%
BenchmarkSelectSyncContended-32      3165          1172          -62.97%
BenchmarkSelectAsyncContended        231           208           -9.96%
BenchmarkSelectAsyncContended-2      671           209           -68.85%
BenchmarkSelectAsyncContended-4      395           215           -45.57%
BenchmarkSelectAsyncContended-8      451           240           -46.78%
BenchmarkSelectAsyncContended-16     486           233           -52.06%
BenchmarkSelectAsyncContended-32     861           395           -54.12%
BenchmarkSelectNonblock              126           36.0          -71.43%
BenchmarkSelectNonblock-2            155           17.6          -88.65%
BenchmarkSelectNonblock-4            285           8.45          -97.04%
BenchmarkSelectNonblock-8            212           4.41          -97.92%
BenchmarkSelectNonblock-16           180           2.44          -98.64%
BenchmarkSelectNonblock-32           395           1.63          -99.59%
BenchmarkSelectProdCons              1140          926           -18.77%
BenchmarkSelectProdCons-2            653           545           -16.54%
BenchmarkSelectProdCons-4            519           352           -32.18%
BenchmarkSelectProdCons-8            667           372           -44.23%
BenchmarkSelectProdCons-16           751           431           -42.61%
BenchmarkSelectProdCons-32           1142          583           -48.95%

Implementation:
https://golang.org/cl/112990043/
@rsc

This comment has been minimized.

Contributor

rsc commented Oct 7, 2014

Comment 1:

I wanted to get this into Go 1.4 but it fell on the floor. Sounds good for Go 1.5.

Labels changed: added release-go1.5, removed release-none.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014

@bradfitz bradfitz removed the release-go1.5 label Dec 16, 2014

@rsc rsc removed accepted labels Apr 14, 2015

@rsc

This comment has been minimized.

Contributor

rsc commented Jun 8, 2015

Postponing per CL discussion.

@rsc rsc modified the milestones: Go1.6, Go1.5 Jun 8, 2015

@rsc rsc modified the milestones: Go1.7Early, Go1.6 Nov 23, 2015

@valyala

This comment has been minimized.

Contributor

valyala commented Apr 14, 2016

@dvyukov , are there any chances to resurrect this CL?

@rsc

This comment has been minimized.

Contributor

rsc commented Apr 15, 2016

Probably not for Go 1.7: it's a big change, it's not ready, and the Go 1.7 dev freeze is just two weeks away. This is the sort of thing that would need to go in early, and it didn't.

@DmitriyMV

This comment has been minimized.

DmitriyMV commented Apr 15, 2016

Is there any particular reason why not?

@rsc rsc modified the milestones: Unplanned, Go1.7Early Apr 15, 2016

@rsc

This comment has been minimized.

Contributor

rsc commented Apr 15, 2016

@DmitriyMV, clarified comment

@bradfitz

This comment has been minimized.

Member

bradfitz commented Aug 16, 2016

@dvyukov, Go 1.8 is open if you're feeling like a project. :-)

@navytux

This comment has been minimized.

Contributor

navytux commented May 29, 2018

@dvyukov, @mdempsky, anyone else on the Go team maybe, just wondering: is there any plan to get fine-grained select locking/speedup merged in the foreseeable future?

In many situations select shows its heavy weight and it would be good to know whether this issue is going to be eventually addressed by the Go project, or you are alone up to fighting it.

"Unplanned" label and history here suggests it is 99% the latter, but there is always a bit of hope...

Thanks beforehand for feedback,
Kirill

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented May 29, 2018

@navytux I'm not aware of anyone working on this. It would be great if someone volunteered to carry this forward for 1.12.

@navytux

This comment has been minimized.

Contributor

navytux commented May 29, 2018

@ianlancetaylor thanks for feedback. At least the status is clear.

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