Skip to content

crypto/tls: drop in BenchmarkThroughput performance #17779

Description

@mundaym

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

go version devel +4141054 Thu Nov 3 17:42:01 2016 +0000 darwin/amd64

What did you do?

go test crypto/tls -bench BenchmarkThroughput

What did you expect to see?

Similar performance to 1.7.1.

What did you see instead?

A slowdown from 1.7.1 (apologies for the noisy benchmarks, this is on my laptop):

name                           old speed     new speed     delta
Throughput/MaxPacket/1MB       137MB/s ±25%  132MB/s ± 8%     ~     (p=0.529 n=10+10)
Throughput/MaxPacket/2MB       162MB/s ±12%  141MB/s ±23%  -13.07%  (p=0.019 n=10+10)
Throughput/MaxPacket/4MB       187MB/s ±23%  158MB/s ±15%  -15.16%  (p=0.007 n=10+10)
Throughput/MaxPacket/8MB       213MB/s ±12%  172MB/s ± 6%  -19.16%  (p=0.000 n=10+9)
Throughput/MaxPacket/16MB      226MB/s ±23%  178MB/s ±20%  -21.11%  (p=0.002 n=10+10)
Throughput/MaxPacket/32MB      238MB/s ± 7%  166MB/s ±22%  -30.32%  (p=0.000 n=10+10)
Throughput/MaxPacket/64MB      228MB/s ±13%  182MB/s ±12%  -20.27%  (p=0.000 n=10+10)
Throughput/DynamicPacket/1MB   137MB/s ±13%  108MB/s ±29%  -21.18%  (p=0.002 n=10+10)
Throughput/DynamicPacket/2MB   160MB/s ±23%  142MB/s ± 7%     ~     (p=0.143 n=10+10)
Throughput/DynamicPacket/4MB   185MB/s ±11%  149MB/s ±13%  -19.69%  (p=0.000 n=10+10)
Throughput/DynamicPacket/8MB   224MB/s ± 7%  174MB/s ±16%  -22.41%  (p=0.000 n=9+10)
Throughput/DynamicPacket/16MB  226MB/s ±18%  177MB/s ±20%  -21.48%  (p=0.001 n=10+10)
Throughput/DynamicPacket/32MB  227MB/s ±20%  169MB/s ±23%  -25.42%  (p=0.000 n=10+10)
Throughput/DynamicPacket/64MB  249MB/s ± 6%  182MB/s ±12%  -26.72%  (p=0.000 n=10+9)

It looks like (although I haven't verified it) this is because the default cipher suite in crypto/tls is now using ChaCha20/Poly1305 in preference to AES-GCM. I suspect this is fine (and is probably better for arm etc.), but I thought I'd open this issue in case it requires documentation or something.

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