go/src/crypto
Tom Bergan ae00df128d crypto/tls: implement dynamic record sizing
Currently, if a client of crypto/tls (e.g., net/http, http2) calls
tls.Conn.Write with a 33KB buffer, that ends up writing three TLS
records: 16KB, 16KB, and 1KB. Slow clients (such as 2G phones) must
download the first 16KB record before they can decrypt the first byte.
To improve latency, it's better to send smaller TLS records. However,
sending smaller records adds overhead (more overhead bytes and more
crypto calls), which slightly hurts throughput.

A simple heuristic, implemented in this change, is to send small
records for new connections, then boost to large records after the
first 1MB has been written on the connection.

Fixes #14376

Change-Id: Ice0f6279325be6775aa55351809f88e07dd700cd
Reviewed-on: https://go-review.googlesource.com/19591
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-03-12 00:47:13 +00:00
..
aes all: single space after period. 2016-03-02 00:13:47 +00:00
cipher crypto/cipher: xorBytes performance ppc64le/ppc64 2016-03-05 01:51:33 +00:00
des
dsa all: remove public named return values when useless 2016-02-29 03:31:19 +00:00
ecdsa all: remove public named return values when useless 2016-02-29 03:31:19 +00:00
elliptic all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
hmac crypto/hmac: update link to FIPS HMAC spec 2016-01-06 02:17:06 +00:00
md5 all: single space after period. 2016-03-02 00:13:47 +00:00
rand all: single space after period. 2016-03-02 00:13:47 +00:00
rc4 all: single space after period. 2016-03-02 00:13:47 +00:00
rsa all: single space after period. 2016-03-02 00:13:47 +00:00
sha1 all: single space after period. 2016-03-02 00:13:47 +00:00
sha256 all: single space after period. 2016-03-02 00:13:47 +00:00
sha512 all: single space after period. 2016-03-02 00:13:47 +00:00
subtle
tls crypto/tls: implement dynamic record sizing 2016-03-12 00:47:13 +00:00
x509 crypto/x509: correct OID for DSA-with-SHA-256. 2016-03-12 00:13:26 +00:00
crypto.go crypto: document that Signer.Sign does not hash 2016-01-26 16:27:16 +00:00