Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6800)

Issue 86020043: code review 86020043: sync: less agressive local caching in Pool (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by dvyukov
Modified:
10 years ago
Reviewers:
gobot, rsc
CC:
rsc, golang-codereviews, khr
Visibility:
Public.

Description

sync: less agressive local caching in Pool Currently Pool can cache up to 15 elements per P, and these elements are not accesible to other Ps. If a Pool caches large objects, say 2MB, and GOMAXPROCS is set to a large value, say 32, then the Pool can waste up to 960MB. The new caching policy caches at most 1 per-P element, the rest is shared between Ps. Get/Put performance is unchanged. Nested Get/Put performance is 57% worse. However, overall scalability of nested Get/Put is significantly improved, so the new policy starts winning under contention. benchmark old ns/op new ns/op delta BenchmarkPool 27.4 26.7 -2.55% BenchmarkPool-4 6.63 6.59 -0.60% BenchmarkPool-16 1.98 1.87 -5.56% BenchmarkPool-64 1.93 1.86 -3.63% BenchmarkPoolOverlflow 3970 6235 +57.05% BenchmarkPoolOverlflow-4 10935 1668 -84.75% BenchmarkPoolOverlflow-16 13419 520 -96.12% BenchmarkPoolOverlflow-64 10295 380 -96.31%

Patch Set 1 #

Patch Set 2 : diff -r 2a858c0830af https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 77578375f623 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 77578375f623 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 77578375f623 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 6

Patch Set 6 : diff -r 77578375f623 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 7 : diff -r 7af8faea95c9 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -121 lines) Patch
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 1 chunk +5 lines, -23 lines 0 comments Download
M src/pkg/sync/pool.go View 1 2 3 4 5 5 chunks +88 lines, -95 lines 0 comments Download
M src/pkg/sync/pool_test.go View 1 2 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 7
dvyukov
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
10 years ago (2014-04-14 14:31:24 UTC) #1
dvyukov
Hello rsc@golang.org (cc: golang-codereviews@googlegroups.com, khr@golang.org), Please take another look.
10 years ago (2014-04-14 14:32:07 UTC) #2
dvyukov
I am still running production tests, but for now this policy looks good. With the ...
10 years ago (2014-04-14 14:34:13 UTC) #3
rsc
LGTM but it needs to go in today so that it will be in the ...
10 years ago (2014-04-14 14:43:54 UTC) #4
dvyukov
https://codereview.appspot.com/86020043/diff/60002/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/86020043/diff/60002/src/pkg/runtime/mgc0.c#newcode111 src/pkg/runtime/mgc0.c:111: reflect·call(poolcleanup, (byte*)&i, 0, 0); On 2014/04/14 14:43:55, rsc wrote: ...
10 years ago (2014-04-14 16:48:09 UTC) #5
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=ad21d6ca5d82 *** sync: less agressive local caching in Pool Currently Pool can ...
10 years ago (2014-04-14 17:13:36 UTC) #6
gobot
10 years ago (2014-04-14 22:46:00 UTC) #7
Message was sent while issue was closed.
This CL appears to have broken the netbsd-amd64-bsiegert builder.
See http://build.golang.org/log/0828cd3aae07c3907ac4d7e96deca4f37dea9550
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b