There is also a command-line proof-of-concept that combines it with profiling information to show you only the missed/unabled optimizations that are also hot spots in the profile.
https://github.com/dr2chase/gc-lsp-tools There's a lot of checks and things that can't be optimized away, but very few have any effect on a typical program's performance. On Fri, Sep 4, 2020 at 4:51 PM Peter Weinberger (温博格) <p...@google.com> wrote: > And gopls will compute them as diagnostics. For instance, if using vscode > and gopls, then in setting.json: > "gopls": { > "codelens": { > "gc_details": true, > } > } > > and a clickable 'Toggle gc annotation details' should appear just above > the package statement. > > On Fri, Sep 4, 2020 at 4:28 PM Ian Lance Taylor <i...@golang.org> wrote: > >> [ + drchase ] >> >> On Fri, Sep 4, 2020 at 1:16 PM Falco Wockenfuß <falco...@gmail.com> >> wrote: >> > >> > sorry if this is a dumb question, but the Release Notes for go 1.15 >> have the Note: >> > The compiler's -json optimization logging now reports large (>= 128 >> byte) copies and includes explanations of escape analysis decisions. >> > >> > But I didn't find anything about "-json" as a flag for go build or >> similar and google dind't yield anything for go compiler json optimization >> logging or similar. >> > >> > Can anyone clarify what this json optimiziation logging is and how it >> can be used/invoked ? >> >> It does seem that this option should be mentioned in cmd/compile/doc.go. >> >> To use it, try "go build -gcflags=json=0,/my/json/dir". >> >> Ian >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVB-pJUf6AxSDsAqoEJbzBm_h7Qt4%2BTJyUg0mE63RyDcQ%40mail.gmail.com >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAHOpXeWf%2BVQg1kXQgOavX4dGtd2Hhku-Xp8u5wyVGMpEwyLP8w%40mail.gmail.com.