Benchmarks in https://github.com/golang/go

166 views
Skip to first unread message

Nikolay Dubina

unread,
Dec 17, 2020, 12:33:43 PM12/17/20
to golang-nuts
Hello,

I am trying to find a dashboard with current benchmarks of go core routines (e.g. math, sort, reflect, etc.). For example, among others, I would like to see these benchmarks: https://github.com/golang/go/blob/master/src/math/all_test.go#L3196

I tried to run it with `go test -bench=. ./...` from the root of "go" repo, but getting errors like for case of "math":

```
package std/math
    exp_asm.go:9:8: use of internal package internal/cpu not allowed
package std/math/big
    big/arith_amd64.go:9:8: use of internal package internal/cpu not allowed
```

I think I am doing something wrong or I am missing some public dashboard. Thus, few questions:

1. How to run benchmarks from `https://github.com/golang/go`?
2. Is there a public official dashboard with benchmarks?
3. Any resources on how benchmarks have changed over last couple of years releases of go?

Thanks,

- Nikolay

Amarjeet Anand

unread,
Aug 7, 2022, 7:58:00 AM8/7/22
to golang-nuts
Hi Nikolay

Did you find a way to achieve this?

peterGo

unread,
Aug 7, 2022, 9:39:06 AM8/7/22
to golang-nuts
For example,

~$ git clone https://github.com/golang/go --depth 1 $HOME/bench
Cloning into '/home/peter/bench'...
# . . .
~$ cd $HOME/bench/src
~/bench/src$ ./make.bash
# . . .
Installed Go for linux/amd64 in /home/peter/bench
Installed commands in /home/peter/bench/bin
~/bench/src$ cd $HOME/bench/src/math
~/bench/src/math$ $HOME/bench/bin/go version
go version devel go1.20-0c4db1e Sat Aug 6 15:20:00 2022 +0000 linux/amd64
~/bench/src/math$ $HOME/bench/bin/go test -run=! -bench=.
# . . .
BenchmarkAcos-4                      100534106            11.59 ns/op
BenchmarkAcosh-4                     58037392            19.77 ns/op
BenchmarkAsin-4                      100000000            11.48 ns/op
BenchmarkAsinh-4                     42365228            27.55 ns/op
BenchmarkAtan-4                      197030109             6.023 ns/op
BenchmarkAtanh-4                     53926764            22.24 ns/op
BenchmarkAtan2-4                     100000000            10.83 ns/op
# . . .
BenchmarkFloat64bits-4               1000000000             0.3137 ns/op
BenchmarkFloat64frombits-4           1000000000             0.3281 ns/op
BenchmarkFloat32bits-4               1000000000             0.3326 ns/op
BenchmarkFloat32frombits-4           1000000000             0.3341 ns/op
BenchmarkFMA-4                       900370222             1.312 ns/op
PASS
ok      math    90.562s
~/bench/src/math$

Installing Go from source: https://go.dev/doc/install/source

Peter

Amarjeet Anand

unread,
Aug 7, 2022, 3:03:34 PM8/7/22
to peterGo, golang-nuts
Thanks Petergo
This was exactly what I was looking for.

Is it documented somewhere?

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/vpvsCDza6cc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/dcdf3fc7-cbe2-48c2-89f2-b838ce4522d5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages