]> Cypherpunks repositories - gostls13.git/commit
internal/trace/v2: store stacks as PCs, not frames
authorDominik Honnef <dominik@honnef.co>
Sat, 20 Jan 2024 16:34:06 +0000 (17:34 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 7 Feb 2024 23:35:44 +0000 (23:35 +0000)
commitd3d390984bffed4a2d188043a498e535953eec3a
treedb98695a53a811aa29621d53528f5993284a942a
parentadbf71eb9869caef8eb61471c0e6a93ead7479e1
internal/trace/v2: store stacks as PCs, not frames

Most stacks share some frames, especially prefixes, and deduplicating
them can save significant amounts of memory.

This will be especially true when we convert traces from the old to the
new format. Here, all stacks exist in a single generation and will be
live together.

For busy traces, such as one of running Staticcheck on std, with CPU
profiling enabled, this change saves ~400 MiB of memory.

Change-Id: Ie676f628dd2715e1c6077747dd4e08acf3331e5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/557355
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/trace/v2/base.go
src/internal/trace/v2/event.go
src/internal/trace/v2/generation.go