Skip to content

x/crypto/chacha20poly1305: linux/arm64 Go 1.9 performance is 3X slower than OpenSSL #22809

Closed
@williamweixiao

Description

@williamweixiao

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 linux/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/go-1.6"
GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_arm64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

go test vendor/golang_org/x/crypto/chacha20poly1305 -bench .

What did you expect to see?

Performance can be on par with OpenSSL (https://blog.cloudflare.com/content/images/2017/11/sym_key_1_core.png)

What did you see instead?

3X slower than OpenSSL( https://blog.cloudflare.com/content/images/2017/11/go_sym_key_1_core.png)

Activity

added this to the Unplanned milestone on Nov 21, 2017
changed the title [-]crypto/chacha20poly1305: linux/arm64 Go 1.9 performance is 3X slower than OpenSSL[/-] [+]x/crypto/chacha20poly1305: linux/arm64 Go 1.9 performance is 3X slower than OpenSSL[/+] on Mar 20, 2018
gopherbot

gopherbot commented on Apr 9, 2018

@gopherbot
Contributor

Change https://golang.org/cl/105895 mentions this issue: crypto/poly1305: arm64 implementation using multiword arithmetic

gopherbot

gopherbot commented on Apr 9, 2018

@gopherbot
Contributor

Change https://golang.org/cl/105896 mentions this issue: crypto/poly1305: arm64 implementation using multiword arithmetic

gopherbot

gopherbot commented on Apr 19, 2018

@gopherbot
Contributor

Change https://golang.org/cl/107628 mentions this issue: internal/chacha20: add arm64 SIMD implementation

vielmetti

vielmetti commented on Jun 26, 2018

@vielmetti

Substantial perf improvements on Cavium ThunderX going from go 1.10.2 to go1.11beta1, but not 3x faster.

ed@ed-2a-bcc-llvm:~$ go version
go version go1.10.2 linux/arm64
ed@ed-2a-bcc-llvm:~$ go test vendor/golang_org/x/crypto/chacha20poly1305 -bench .
goos: linux
goarch: arm64
pkg: vendor/golang_org/x/crypto/chacha20poly1305
BenchmarkChacha20Poly1305Open_64-96               500000              3047 ns/op          21.00 MB/s
BenchmarkChacha20Poly1305Seal_64-96               500000              2920 ns/op          21.91 MB/s
BenchmarkChacha20Poly1305Open_1350-96              50000             30990 ns/op          43.56 MB/s
BenchmarkChacha20Poly1305Seal_1350-96              50000             30890 ns/op          43.70 MB/s
BenchmarkChacha20Poly1305Open_8K-96                10000            173794 ns/op          47.14 MB/s
BenchmarkChacha20Poly1305Seal_8K-96                10000            173907 ns/op          47.11 MB/s
PASS
ok      vendor/golang_org/x/crypto/chacha20poly1305     10.538s
ed@ed-2a-bcc-llvm:~$ 
ed@ed-2a-bcc-llvm:~$ ~/go/bin/go1.11beta1 test vendor/golang_org/x/crypto/chacha20poly1305 -bench .
goos: linux
goarch: arm64
pkg: vendor/golang_org/x/crypto/chacha20poly1305
BenchmarkChacha20Poly1305Open_64-96              1000000              2249 ns/op          28.45 MB/s
BenchmarkChacha20Poly1305Seal_64-96              1000000              2245 ns/op          28.50 MB/s
BenchmarkChacha20Poly1305Open_1350-96             100000             19541 ns/op          69.08 MB/s
BenchmarkChacha20Poly1305Seal_1350-96             100000             19439 ns/op          69.45 MB/s
BenchmarkChacha20Poly1305Open_8K-96                10000            105547 ns/op          77.61 MB/s
BenchmarkChacha20Poly1305Seal_8K-96                10000            105938 ns/op          77.33 MB/s
PASS
ok      vendor/golang_org/x/crypto/chacha20poly1305     11.173s
mengzhuo

mengzhuo commented on Jun 29, 2018

@mengzhuo
Contributor

@vielmetti internal/chacha20 won't be merged into go1.11 since it's frozen.

vielmetti

vielmetti commented on Jun 29, 2018

@vielmetti

Thanks @mengzhuo . Can we get this onto the go1.12 roster then? It's currently marked as "Unplanned".

10 remaining items

modified the milestones: Go1.12, Go1.13 on Feb 12, 2019
modified the milestones: Go1.13, Go1.14 on Jul 8, 2019
modified the milestones: Go1.14, Backlog on Oct 9, 2019
rfjakob

rfjakob commented on Apr 11, 2020

@rfjakob
mengzhuo

mengzhuo commented on Dec 16, 2020

@mengzhuo
Contributor

Could someone close this issue? Apparently it's done.

locked and limited conversation to collaborators on Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zx2c4@titanous@vielmetti@rsc@rfjakob

        Issue actions

          x/crypto/chacha20poly1305: linux/arm64 Go 1.9 performance is 3X slower than OpenSSL · Issue #22809 · golang/go