You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PGO: Run benchmarks for a shorter time, but force GC to run more often.
The PGO profiles don't need to run that long, but they do need to ensure
GC happens a few times to exercise GC-triggered codepaths (e.g. on
`sync.Pool` objects, network packet chunk pools, etc).
This change introduces a flag to force GC to run on a set interval during
CPU profiling, and enables it for PGO benchmark runs. It also reduces the
PGO benchmark time target, since GC is now guaranteed to run a couple of
times.
It also deletes all profiles, in order to force them to be refreshed
with this change in effect.
PiperOrigin-RevId: 797835198
flagSet.Bool("profile", false, "prepares the sandbox to use Golang profiler. Note that enabling profiler loosens the seccomp protection added to the sandbox (DO NOT USE IN PRODUCTION).")
100
100
flagSet.String("profile-block", "", "collects a block profile to this file path for the duration of the container execution. Requires -profile=true.")
101
101
flagSet.String("profile-cpu", "", "collects a CPU profile to this file path for the duration of the container execution. Requires -profile=true.")
102
+
flagSet.Duration("profile-gc-interval", 0, "forces a garbage collection cycle every this duration while another type of time-based profiling is enabled. Requires -profile=true.")
102
103
flagSet.String("profile-heap", "", "collects a heap profile to this file path for the duration of the container execution. Requires -profile=true.")
103
104
flagSet.String("profile-mutex", "", "collects a mutex profile to this file path for the duration of the container execution. Requires -profile=true.")
104
105
flagSet.String("trace", "", "collects a Go runtime execution trace to this file path for the duration of the container execution.")
0 commit comments