---
title: "Profiling improvements in Go 1.18"
description: "Go 1.18's Linux CPU profiler no longer underestimates CPU bursts on multi-core systems."
url: "https://swe.quest/articles/profiling-improvements-in-go-1-18-696a3ae4a6369181"
canonical: "https://www.datadoghq.com/blog/engineering/profiling-improvements-in-go-1-18/"
source: "Datadog Engineering"
published: "2022-02-28"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 8
tags: ["go","performance","runtimes","linux","observability"]
---

# Profiling improvements in Go 1.18

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2022-02-28, 8 min read, Deep dive. Original: [https://www.datadoghq.com/blog/engineering/profiling-improvements-in-go-1-18/](https://www.datadoghq.com/blog/engineering/profiling-improvements-in-go-1-18/)

## Summary

Go 1.18's Linux CPU profiler no longer underestimates CPU bursts on multi-core systems. The fix replaces reliance on setitimer(2) with per-thread timer\_create(2) timers, because process-directed SIGPROF signals don't queue, coalesce within 4 ms jiffy windows, and are unfairly distributed across threads. The release also fixes pprof labels that were missing or wrong: the profiler read gp instead of gp.m.curg during stack switches, mislabeled the first batch of samples through an off-by-one error, and let system goroutines inherit labels. A Go 1.17 compiler regression with inlined closures was also fixed; it made pc symbolization non-deterministic and produced negative counts in delta allocation profiles.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Go](https://swe.quest/tags/go.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)

## Prerequisites

- Go runtime and goroutines ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- POSIX signals
- pprof profiling basics ([easy posts on Performance engineering](https://swe.quest/tags/performance.md?difficulty=easy))

## Keywords

Go 1.18, pprof, setitimer, timer\_create, SIGPROF, cgo, profiler labels

## Related posts

- [Goroutine Leak Profiles](https://swe.quest/articles/goroutine-leak-profiles-28367c8af5986ce1.md): The Go Blog · 2026-09-02 · Medium · 23 min read · Go, Concurrency, Memory management, Debugging, Runtimes & VMs
  Go 1.27 adds a goroutineleak profile that finds goroutines permanently blocked on channels or sync primitives (Mutex, RWMutex, WaitGroup, Cond) in running programs, including production, with few or no false positives.
- [Debugging Go compiler performance in a large codebase](https://swe.quest/articles/debugging-go-compiler-performance-in-a-large-codebase-46b7968c79fa2123.md): incident.io · 2024-01-15 · Medium · 6 min read · Go, Build systems, Developer productivity, Performance engineering
  incident.io sped up builds of its Go monolith by tracing the compiler with \`go build -debug-trace\` and viewing the output in Perfetto.
- [Adding the V8 CPU Profiler to v8go](https://swe.quest/articles/adding-the-v8-cpu-profiler-to-v8go-57f5c1c58134c15f.md): Shopify Engineering · 2022-03-04 · Medium · 10 min read · Go, Performance engineering, API design, Runtimes & VMs, JavaScript
  Exposing V8's CPU profiler through v8go, the Go library for running JavaScript in V8 isolates via Cgo, came down to a choice between lazily fetching each profile node property with its own Cgo call or eagerly building the whole call tree in C++ and rebuilding it in Go from a single pointer.
- [Profiling in PyTorch (Part 1): A Beginner's Guide to torch.profiler](https://swe.quest/articles/profiling-in-pytorch-part-1-a-beginner-s-guide-to-torch-profiler-de0c791495fa22c4.md): Hugging Face · 2026-05-29 · Medium · 27 min read · Performance engineering, Machine learning, Python, Debugging
  torch.profiler produces two artifacts: a statistical table showing where time goes and a Chrome/Perfetto trace showing when CPU and GPU events happen.
- [.NET Continuous Profiler: CPU and wall time profiling](https://swe.quest/articles/net-continuous-profiler-cpu-and-wall-time-profiling-5dcdacf43942cb04.md): Datadog Engineering · 2024-02-13 · Hard · 10 min read · .NET, Performance engineering, Runtimes & VMs, Observability, Linux
  Datadog's .NET continuous profiler samples managed threads every 10 ms instead of relying on ETW, perf or enter/leave hooks, which cost too much for 24/7 production use.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
