Reorder fields in `QuicCryptoNegotiatedParameters` to reduce its size from 360B to 352B (go/memory-cy).
As part of go/memory-cy, this CL reorders the fields of `quic::QuicCryptoNegotiatedParameters` to reduce its size from 360B to 352B. For single allocations, this drops the TCMalloc size class from 448B to 352B, saving ~498.0 GiB of fleet RAM.
To ensure no GCU regressions, we checked field-level `heapaccessz_all_loads` profiles and confirmed that hot fields are not split or displaced across 64-byte cache lines. We will also monitor for any GCU regressions with `gwp-cl-impact`.
EDIT_CATEGORY: CATEGORY_TYPE_FIELD_REORDERING
FULLY_QUALIFIED_TYPE_NAME: quic::QuicCryptoNegotiatedParameters
#gwp-cl-impact
Tested:
Local presubmit tests failed.
Some test failures are present; the CL author decided to mail
PiperOrigin-RevId: 991092377
diff --git a/quiche/quic/core/crypto/crypto_handshake.h b/quiche/quic/core/crypto/crypto_handshake.h
index 18f2085..d01c937 100644
--- a/quiche/quic/core/crypto/crypto_handshake.h
+++ b/quiche/quic/core/crypto/crypto_handshake.h
@@ -136,16 +136,11 @@
// bytes of x coordinate, followed by 32 bytes of y coordinate. Both values
// are big-endian and the pair is a P-256 public key.
std::string channel_id;
- QuicTag token_binding_key_param;
-
// Used when generating proof signature when sending server config updates.
// Used to generate cert chain when sending server config updates.
std::string client_cached_cert_hashes;
-
- // Default to false; set to true if the client indicates that it supports sct
- // by sending CSCT tag with an empty value in client hello.
- bool sct_supported_by_client;
+ QuicTag token_binding_key_param;
// Parameters only populated for TLS handshakes. These will be 0 for
// connections not using TLS, or if the TLS handshake is not finished yet.
@@ -155,6 +150,10 @@
// TLS handshake.
uint16_t signature_algorithm_used = 0;
uint16_t peer_signature_algorithm = 0;
+
+ // Default to false; set to true if the client indicates that it supports sct
+ // by sending CSCT tag with an empty value in client hello.
+ bool sct_supported_by_client;
bool encrypted_client_hello = false;
protected: