Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Go
/
Go
A benchmark performs expensive fixture setup before its measured loop. Which change isola…
from Go
advanced
1 min
A benchmark performs expensive fixture setup before its measured loop. Which change isolates the operation cost?
Finish setup, then call `b.ResetTimer()` immediately before the `b.N` loop.
Move setup inside every iteration so the benchmark includes more work.
Replace `b.N` with a fixed loop count so setup becomes negligible.
Check
Ask AI about this kata
Report an error
previous kata
Which filename suffix makes a Go source file part of the test build?
Fill in
next kata
A service has intermittent scheduler latency between goroutines, but a CPU profile shows …
Quiz
A new version is available
Reload