runtime: per-P defer pool
Instead of a per-goroutine stack of defers for all sizes,
introduce per-P defer pool for argument sizes 8, 24, 40, 56, 72 bytes.
For a program that starts 1e6 goroutines and then joins then:
old: rss=6.6g virtmem=10.2g time=4.85s
new: rss=4.5g virtmem= 8.2g time=3.48s
I've collected defer arg sizes during 'go test std', the bulk is 8, + there ...
10 years, 3 months ago
(2013-12-31 09:55:39 UTC)
#2
I've collected defer arg sizes during 'go test std', the bulk is 8, + there are
some 0, 16, 24 and 32. The only outliner is 56 all coming from "defer
syscall.Syscall(syscall.SYS_MUNMAP, base+off, 65536, 0)" in runtime test.
*** Submitted as https://code.google.com/p/go/source/detail?r=a848bcb2adf7 *** runtime: per-P defer pool Instead of a per-goroutine stack of ...
10 years, 2 months ago
(2014-01-21 07:20:28 UTC)
#4
*** Submitted as https://code.google.com/p/go/source/detail?r=a848bcb2adf7 ***
runtime: per-P defer pool
Instead of a per-goroutine stack of defers for all sizes,
introduce per-P defer pool for argument sizes 8, 24, 40, 56, 72 bytes.
For a program that starts 1e6 goroutines and then joins then:
old: rss=6.6g virtmem=10.2g time=4.85s
new: rss=4.5g virtmem= 8.2g time=3.48s
R=golang-codereviews, rsc
CC=golang-codereviews
https://codereview.appspot.com/42750044
Issue 42750044: code review 42750044: runtime: per-P defer pool
(Closed)
Created 10 years, 3 months ago by dvyukov
Modified 10 years, 2 months ago
Reviewers:
Base URL:
Comments: 0