Skip to content
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 · 11 comments
Open

runtime: fine-grained locking in select #8896

dvyukov opened this issue Oct 7, 2014 · 11 comments
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. Performance
Milestone

Comments

@dvyukov
Copy link
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
Copy link
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.

@rsc
Copy link
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
Copy link
Contributor

valyala commented Apr 14, 2016

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

@rsc
Copy link
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
Copy link

Is there any particular reason why not?

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

rsc commented Apr 15, 2016

@DmitriyMV, clarified comment

@bradfitz
Copy link
Contributor

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

@navytux
Copy link
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
Copy link
Contributor

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

@ianlancetaylor ianlancetaylor added the early-in-cycle A change that should be done early in the 3 month dev cycle. label May 29, 2018
@navytux
Copy link
Contributor

navytux commented May 29, 2018

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

@navytux
Copy link
Contributor

navytux commented May 28, 2020

/cc @CAFxX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. Performance
Projects
None yet
Development

No branches or pull requests

7 participants