aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/debug
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-04-14 21:13:32 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-04-14 21:13:32 +0400
commit8fc6ed4c8901d13fe1a5aa176b0ba808e2855af5 (patch)
tree3e8135f1a9deafb7d68a6cb9712bb28742be5815 /src/pkg/debug
parent1e1506a2c1f12362ee5015ef23e9cf092ff284e4 (diff)
downloadgo-8fc6ed4c8901d13fe1a5aa176b0ba808e2855af5.tar.xz
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% LGTM=rsc R=rsc CC=golang-codereviews, khr https://golang.org/cl/86020043
Diffstat (limited to 'src/pkg/debug')
0 files changed, 0 insertions, 0 deletions