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

math/rand: 172 second tests on arm5 #10749

bradfitz opened this issue May 7, 2015 · 15 comments

math/rand: 172 second tests on arm5 #10749

bradfitz opened this issue May 7, 2015 · 15 comments


Copy link

@bradfitz bradfitz commented May 7, 2015

I just noticed on Scaleway, go test -short math/rand takes 172 seconds:

ok      math/rand   172.490s

Figure out why.

The rest:

##### Testing packages.
ok      archive/tar 0.045s
ok      archive/zip 4.563s
ok      bufio   0.517s
ok      bytes   0.799s
ok      compress/bzip2  0.337s
ok      compress/flate  3.081s
ok      compress/gzip   0.038s
ok      compress/lzw    0.466s
ok      compress/zlib   6.332s
ok      container/heap  0.018s
ok      container/list  0.016s
ok      container/ring  0.057s
?       crypto  [no test files]
ok      crypto/aes  0.103s
ok      crypto/cipher   0.027s
ok      crypto/des  0.080s
ok      crypto/dsa  0.053s
ok      crypto/ecdsa    0.353s
ok      crypto/elliptic 0.284s
ok      crypto/hmac 0.025s
ok      crypto/md5  0.027s
ok      crypto/rand 0.086s
ok      crypto/rc4  0.650s
ok      crypto/rsa  1.498s
ok      crypto/sha1 0.019s
ok      crypto/sha256   0.022s
ok      crypto/sha512   0.027s
ok      crypto/subtle   0.039s
ok      crypto/tls  11.691s
ok      crypto/x509 10.017s
?       crypto/x509/pkix    [no test files]
ok      database/sql    0.237s
ok      database/sql/driver 0.015s
ok      debug/dwarf 0.054s
ok      debug/elf   0.094s
ok      debug/gosym 0.015s
ok      debug/macho 0.031s
ok      debug/pe    0.081s
ok      debug/plan9obj  0.019s
?       encoding    [no test files]
ok      encoding/ascii85    0.024s
ok      encoding/asn1   0.030s
ok      encoding/base32 0.021s
ok      encoding/base64 0.021s
ok      encoding/binary 0.021s
ok      encoding/csv    0.020s
ok      encoding/gob    0.463s
ok      encoding/hex    0.018s
ok      encoding/json   1.429s
ok      encoding/pem    0.021s
ok      encoding/xml    0.070s
ok      errors  0.017s
ok      expvar  0.026s
ok      flag    0.021s
ok      fmt 0.335s
ok      go/ast  0.030s
ok      go/build    0.889s
ok      go/constants    0.025s
ok      go/doc  0.328s
ok      go/format   0.051s
?       go/importer [no test files]
ok      go/internal/gcimporter  3.826s
ok      go/parser   0.195s
ok      go/printer  2.101s
ok      go/scanner  0.027s
ok      go/token    0.206s
ok      go/types    11.842s
?       hash    [no test files]
ok      hash/adler32    0.041s
ok      hash/crc32  0.016s
ok      hash/crc64  0.015s
ok      hash/fnv    0.015s
ok      html    0.035s
ok      html/template   0.256s
ok      image   1.134s
ok      image/color 0.598s
?       image/color/palette [no test files]
ok      image/draw  0.629s
ok      image/gif   0.417s
?       image/internal/imageutil    [no test files]
ok      image/jpeg  17.743s
ok      image/png   0.278s
ok      index/suffixarray   0.052s
?       internal/format [no test files]
?       internal/mime   [no test files]
ok      internal/singleflight   0.116s
?       internal/syscall/unix   [no test files]
?       internal/trace  [no test files]
ok      io  0.038s
ok      io/ioutil   0.024s
ok      log 0.038s
ok      log/syslog  2.099s
ok      math    0.592s
ok      math/big    11.767s
ok      math/cmplx  0.074s
ok      math/rand   172.490s
ok      mime    0.061s
ok      mime/multipart  0.490s
ok      mime/quotedprintable    1.067s
ok      net 2.845s
ok      net/http    11.935s
ok      net/http/cgi    1.138s
ok      net/http/cookiejar  0.045s
ok      net/http/fcgi   0.035s
ok      net/http/httptest   0.027s
ok      net/http/httputil   0.062s
ok      net/http/internal   0.033s
?       net/http/pprof  [no test files]
ok      net/internal/socktest   0.016s
ok      net/mail    0.022s
ok      net/rpc 0.093s
ok      net/rpc/jsonrpc 0.054s
ok      net/smtp    0.204s
ok      net/textproto   0.052s
ok      net/url 0.034s
ok      os  0.447s
ok      os/exec 0.697s
ok      os/signal   3.451s
ok      os/user 0.019s
ok      path    0.017s
ok      path/filepath   0.125s
ok      reflect 0.591s
ok      regexp  1.017s
ok      regexp/syntax   2.506s
ok      runtime 150.688s
?       runtime/cgo [no test files]
ok      runtime/debug   0.044s
ok      runtime/pprof   9.510s
?       runtime/race    [no test files]
ok      sort    0.401s
ok      strconv 2.668s
ok      strings 0.880s
ok      sync    0.535s
ok      sync/atomic 4.420s
ok      syscall 0.080s
ok      testing 1.455s
?       testing/iotest  [no test files]
ok      testing/quick   0.275s
ok      text/scanner    0.026s
ok      text/tabwriter  0.036s
ok      text/template   0.181s
ok      text/template/parse 0.053s
ok      time    4.096s
ok      unicode 0.039s
ok      unicode/utf16   0.015s
ok      unicode/utf8    0.029s
?       unsafe  [no test files]
?       cmd/5g  [no test files]
?       cmd/5l  [no test files]
?       cmd/6g  [no test files]
?       cmd/6l  [no test files]
?       cmd/7g  [no test files]
?       cmd/7l  [no test files]
?       cmd/8g  [no test files]
?       cmd/8l  [no test files]
?       cmd/9g  [no test files]
?       cmd/9l  [no test files]
ok      cmd/addr2line   9.595s
ok      cmd/api 0.052s
?       cmd/asm [no test files]
?       cmd/asm/internal/arch   [no test files]
ok      cmd/asm/internal/asm    0.147s
?       cmd/asm/internal/flags  [no test files]
ok      cmd/asm/internal/lex    0.017s
?       cmd/cgo [no test files]
ok      cmd/cover   18.654s
?       cmd/dist    [no test files]
?       cmd/doc [no test files]
ok      cmd/fix 0.084s
ok      cmd/go  0.083s
ok      cmd/gofmt   0.265s
?       cmd/internal/asm    [no test files]
?       cmd/internal/gc [no test files]
ok      cmd/internal/gc/big 10.154s
ok      cmd/internal/goobj  0.015s
?       cmd/internal/ld [no test files]
ok      cmd/internal/obj    0.021s
?       cmd/internal/obj/arm    [no test files]
?       cmd/internal/obj/arm64  [no test files]
?       cmd/internal/obj/ppc64  [no test files]
ok      cmd/internal/obj/x86    0.203s
?       cmd/internal/objfile    [no test files]
ok      cmd/internal/  0.046s
ok      cmd/internal/  1.327s
ok      cmd/link    0.112s
ok      cmd/nm  9.056s
ok      cmd/objdump 28.396s
?       cmd/old5a   [no test files]
?       cmd/old6a   [no test files]
?       cmd/old8a   [no test files]
?       cmd/old9a   [no test files]
ok      cmd/pack    19.998s
?       cmd/pprof   [no test files]
?       cmd/pprof/internal/commands [no test files]
?       cmd/pprof/internal/driver   [no test files]
?       cmd/pprof/internal/fetch    [no test files]
?       cmd/pprof/internal/plugin   [no test files]
ok      cmd/pprof/internal/profile  0.032s
?       cmd/pprof/internal/report   [no test files]
?       cmd/pprof/internal/svg  [no test files]
?       cmd/pprof/internal/symbolizer   [no test files]
?       cmd/pprof/internal/symbolz  [no test files]
?       cmd/pprof/internal/tempfile [no test files]
?       cmd/trace   [no test files]
?       cmd/yacc    [no test files]

##### GOMAXPROCS=2 runtime -cpu=1,2,4
ok      runtime 393.990s

##### sync -cpu=10
ok      sync    0.548s

/cc @davecheney

@bradfitz bradfitz added this to the Go1.5Maybe milestone May 7, 2015
Copy link
Contributor Author

@bradfitz bradfitz commented May 7, 2015

Related #10571

Copy link

@josharian josharian commented May 7, 2015

Related to #9732?

Copy link
Contributor Author

@bradfitz bradfitz commented May 7, 2015

Indeed, this is an linux-arm-arm5 build underway.

@bradfitz bradfitz changed the title math/rand: 172 second tests on ARM math/rand: 172 second tests on arm5 May 7, 2015
Copy link

@minux minux commented May 7, 2015

@minux minux modified the milestones: Go1.6, Go1.5Maybe May 12, 2015
Copy link

@minux minux commented May 12, 2015

Copy link
Contributor Author

@bradfitz bradfitz commented May 12, 2015

For now can we skip or shorten this test in testing.Short() mode when GOARM=="5" ?

Copy link

@davecheney davecheney commented May 13, 2015

Copy link

@minux minux commented May 13, 2015

Copy link

@davecheney davecheney commented May 13, 2015

Hmm, what do you think of skipping that test for arm5 only?

On Wed, 13 May 2015 16:47 Minux Ma wrote:

$ /usr/bin/time ./rand.test -test.v -test.short
=== RUN TestStandardNormalValues
--- PASS: TestStandardNormalValues (0.78s)
=== RUN TestNonStandardNormalValues
--- PASS: TestNonStandardNormalValues (2.68s)
=== RUN TestStandardExponentialValues
--- PASS: TestStandardExponentialValues (0.74s)
=== RUN TestNonStandardExponentialValues
--- PASS: TestNonStandardExponentialValues (1.42s)
=== RUN TestNormTables
--- PASS: TestNormTables (0.02s)
=== RUN TestExpTables
--- PASS: TestExpTables (0.05s)
=== RUN TestFloat32
--- PASS: TestFloat32 (152.13s)
=== RUN TestRegress
--- PASS: TestRegress (0.01s)
=== RUN Example
--- PASS: Example (0.00s)
=== RUN Example_rand
--- PASS: Example_rand (0.00s)
157.82user 0.34system 2:37.85elapsed 100%CPU (0avgtext+0avgdata
0inputs+0outputs (0major+1223minor)pagefaults 0swaps

As you can see, most of the time is spent in TestFloat32, which uses a lot
of floating point

Reply to this email directly or view it on GitHub
#10749 (comment).

Copy link

@robpike robpike commented May 13, 2015

I wonder if it would be a good or bad idea to use the new math/big.Float stuff in the emulation.

Copy link
Contributor Author

@bradfitz bradfitz commented May 13, 2015

/cc @griesemer per previous comment

@bradfitz bradfitz closed this in f8fbcef May 13, 2015
Copy link

@griesemer griesemer commented May 13, 2015

@robpike I don't know the details of the emulation, but I suspect using math/big.Float would not be good. For one, it also needs (machine) floating-point operations.

Copy link

@minux minux commented May 14, 2015

Copy link

@griesemer griesemer commented May 14, 2015

@minux There's no obvious low-hanging fruit I can see. It's hard to make this fast w/o making it incomprehensible.

Copy link

@minux minux commented May 15, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.