Skip to content
This repository has been archived by the owner on May 2, 2018. It is now read-only.

Commit

Permalink
testing: always ignore RunParallel in probe phase
Browse files Browse the repository at this point in the history
Change-Id: If45410a2d7e48d1c9e6800cd98f81dd89024832c
Reviewed-on: https://go-review.googlesource.com/20852
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
mpvl authored and rsc committed Mar 18, 2016
1 parent 872ca73 commit f39d6d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/testing/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,11 @@ func (pb *PB) Next() bool {
// The body function will be run in each goroutine. It should set up any
// goroutine-local state and then iterate until pb.Next returns false.
// It should not use the StartTimer, StopTimer, or ResetTimer functions,
// because they have global effect.
// because they have global effect. It should also not call Run.
func (b *B) RunParallel(body func(*PB)) {
if b.N == 0 {
return // Nothing to do when probing.
}
// Calculate grain size as number of iterations that take ~100µs.
// 100µs is enough to amortize the overhead and provide sufficient
// dynamic load balancing.
Expand Down

0 comments on commit f39d6d9

Please sign in to comment.