Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark: consider the use of GOMAXPROCS in place of numCPU #339

Open
weikengchen opened this issue Feb 11, 2023 · 0 comments
Open

benchmark: consider the use of GOMAXPROCS in place of numCPU #339

weikengchen opened this issue Feb 11, 2023 · 0 comments

Comments

@weikengchen
Copy link

This is related to benchmarking. When benchmarking in Golang, one can set an additional parameter to specify the number of CPUs allowed to that program, with a flag -cpu=2,4,8.
https://dev.to/mcaci/introduction-to-benchmarks-in-go-3cii

This parameter, interestingly, only affects runtime.GOMAXPROCS(0) but not runtime.numCPU(). Therefore, when one uses the flag above to limit the number of CPU cores when benchmarking, a number of functions in the codebase, such as FFT, will mispredict the number of CPUs available to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant