From 65dcddeb4e80b9a23ec6fc0157ecab388ba2f34f Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 25 May 2023 13:57:25 -0400 Subject: [PATCH] doc/go1.21: document PGO GA and devirtualization For #59959. For #58645. Change-Id: I574153ef2fd61a5e90ec281fca065c42fce22cc1 Reviewed-on: https://go-review.googlesource.com/c/go/+/498263 Reviewed-by: Eli Bendersky Run-TryBot: Michael Pratt Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot --- doc/go1.21.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/go1.21.html b/doc/go1.21.html index 970ff47394..9c1383a16f 100644 --- a/doc/go1.21.html +++ b/doc/go1.21.html @@ -261,6 +261,25 @@ Do not send CLs removing the interior tags from such phrases.

Compiler

+

+ Profile-guide optimization (PGO), added as a preview in Go 1.20, is now ready + for general use. PGO enables additional optimizations on code identified as + hot by profiles of production workloads. As mentioned in the + Go command section, PGO is enabled by default for + binaries that contain a default.pgo profile in the main + package directory. Performance improvements vary depending on application + behavior, with most programs from a representative set of Go programs seeing + between 2 and 7% improvement from enabling PGO. See the + PGO user guide for detailed documentation. +

+ + +

+ PGO builds can now devirtualize some interface method calls, adding a + concrete call to the most common callee. This enables further optimization, + such as inlining the callee. +

+

-- 2.44.0