4

Waiting for go1.21: Execution Tracing with < 1% Overhead

 1 year ago
source link: https://blog.felixge.de/waiting-for-go1-21-execution-tracing-with-less-than-one-percent-overhead/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Jun 30, 2023 2 min read go

Waiting for go1.21: Execution Tracing with < 1% Overhead

Learn about the upcoming go1.21 performance improvements that reduce the overhead of execution tracing from up to 20% to less than 1% for most applications.
Waiting for go1.21: Execution Tracing with < 1% Overhead

Go’s execution tracer (aka go tool trace) has suffered from high overhead since its inception in 2014. Historically this has forced potential users to worry about up to 20% of CPU overhead when turning it on. Because of this, it's mostly been used in test environments or desperate situations rather than gaining adoption as a continuous profiling signal in production.

However, in early 2023 my colleague Nick Ripley and I started to become convinced that we could change this by implementing frame pointer unwinding. You can read more about the details in the blog post below:

CleanShot-2023-02-05-at-12.01.54-2@2x.png

Since then we’ve been actively collaborating with the Go runtime team at Google, in particular Michael Knyszek, Michael Pratt and Cherry Mui in order to make this a reality. And at this point it looks like we’ve succeeded: The upcoming go1.21 release will feature a new version of the tracer which should provide less than 1% overhead for most applications 🥳 (see upcoming release notes).

Below is a list of directly or indirectly related patches that contributed to this effort:

So if you're into Go performance and observability, this improvement is definitely something to look forward to.

And this is just the beginning:

  1. Michael Knyszek has proposed a lot of exciting improvements that will further improve execution tracing in upcoming releases.
  2. Dominik Honnef's gotraceui viewer keeps improving.
  3. We've also been busy with integrating the execution tracer into our profiling product at Datadog. We'll share more information about this soon.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK