Skip to content

testing: better documentation for RunParallel #7433

@dvyukov

Description

@dvyukov
From golang-dev:

Before the 1.3 release, could the documentation be improved on RunParallel (and probably
by extension SetParallel). I was looking at it today and I am confused on the intended
usage.

For my case, I believe I don't need to use them, but I don't think the documentation for
RunParallel and SetParallel gives a good enough sense for when they should be used.
RunParallel says "It creates multiple goroutines and distributes b.N iterations
among them". Is the purpose to make the benchmark go faster by executing it
concurrently? Is the point to measure how concurrently executing processes interact with
one another? In addition to an answer to that question, it would be great to add more
prose explaining the kinds of benchmarks where one would want to use SetParallelism and
RunParallel. All SetParallelism says is that you shouldn't do it if you are CPU-bound.
Adding text like "SetParallelism is useful, say, to measure the memory used by
spawning many worker goroutines" (assuming that's correct).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions