From c9152a8568fd49b2e7a5dd689005098487a6178d Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Tue, 12 Jul 2011 09:24:32 -0700 Subject: runtime: eliminate contention during stack allocation Standard-sized stack frames use plain malloc/free instead of centralized lock-protected FixAlloc. Benchmark results on HP Z600 (2 x Xeon E5620, 8 HT cores, 2.40GHz) are as follows: benchmark old ns/op new ns/op delta BenchmarkStackGrowth 1045.00 949.00 -9.19% BenchmarkStackGrowth-2 3450.00 800.00 -76.81% BenchmarkStackGrowth-4 5076.00 513.00 -89.89% BenchmarkStackGrowth-8 7805.00 471.00 -93.97% BenchmarkStackGrowth-16 11751.00 321.00 -97.27% R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4657091 --- src/pkg/runtime/stack.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pkg/runtime/stack.h') diff --git a/src/pkg/runtime/stack.h b/src/pkg/runtime/stack.h index 2b6b0e3876..cf35365366 100644 --- a/src/pkg/runtime/stack.h +++ b/src/pkg/runtime/stack.h @@ -71,6 +71,7 @@ enum { // If the amount needed for the splitting frame + StackExtra // is less than this number, the stack will have this size instead. StackMin = 4096, + FixedStack = StackMin, // Functions that need frames bigger than this call morestack // unconditionally. That is, on entry to a function it is assumed -- cgit v1.3-5-g9baa