5 ms·
> The cost of race detection varies by program, but for a typical program, memory usage may increase by 5-10x and execution time by 2-20x. That's "let's run th
by swatcoder 3y ago
> The cost of race detection varies by program, but for a typical program, memory usage may increase by 5-10x and execution time by 2-20x.
That's "let's run the race detector and get some coffee" overhead, not "let's leave it on in dev" overhead.
Still cool that they have it available!
- cdelsolar 3y agoI am always running everything in race mode when developing locally and have caught stuff before.
- TheDong 3y agoThe main value of the race detector is enabling it for tests (go test -race), and then writing sufficiently exhaustive unit tests to cover all code paths. I do think most gophers, instead of tests, use a combination of prayer and automatically restarting crashed processes when they inevitably panic from a race, which seems to work better than you'd expect!