How does the Go race detector work conceptually, and what are the performance trade-offs of using it during testing?

Last updated 20 June 2026

  • With -race, the compiler instruments every memory access and sync event. A happens-before (vector-clock) model flags two concurrent unordered accesses where at least one is a write.

  • It only catches races that actually occur during the run, so it needs representative concurrent workloads. Reported races are real (no false positives).

  • It costs roughly 5-10x CPU and memory, so run it in tests and CI, not production.

  • https://www.reddit.com/r/rust/comments/1h15md8/goodbye_rust_i_wish_you_success_but_im_back_to_c/
  • https://www.reddit.com/r/golang/comments/1gfjnzm/since_when_is_senior_golang_developer_expected_to/
All Golang interview questions