Make ciphersuite enum smaller - #2172
Merged
Merged
Conversation
Use `#[repr(u16)]` to define wire type, rather than `@U16`.
This changes the output for `Unknown` variants: - from `Unknown(<decimal value>)` - to `TypeName(0x<hex value>)` in preparation for eliding other uncommon variants in Debug output. The hex output matches how IANA documents the most common ones: cipher suites and signature schemes.
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2172 +/- ##
==========================================
- Coverage 94.71% 94.71% -0.01%
==========================================
Files 102 102
Lines 23748 23769 +21
==========================================
+ Hits 22493 22512 +19
- Misses 1255 1257 +2 ☔ View full report in Codecov by Sentry. |
djc
approved these changes
Oct 21, 2024
djc
reviewed
Oct 21, 2024
ctz
force-pushed
the
jbp-smaller-ciphersuite-enum
branch
from
October 21, 2024 16:01
17abb94 to
b5ab4cc
Compare
Arrange that uncommon variants have their match arms in `Debug::fmt` omitted. Things are uncommon if they are prior to TLS1.2, or were never commonly used in TLS1.2 -- it is not a 100% overlap with things we implement. Before: > 0.1% 0.4% 9.0KiB rustls <rustls::enums::CipherSuite as core::fmt::Debug>::fmt After: > 0.0% 0.0% 768B rustls <rustls::enums::CipherSuite as core::fmt::Debug>::fmt
ctz
force-pushed
the
jbp-smaller-ciphersuite-enum
branch
from
October 21, 2024 16:04
b5ab4cc to
f67992e
Compare
cpu
approved these changes
Oct 21, 2024
cpu
left a comment
Member
There was a problem hiding this comment.
New syntax looks like an improvement to me, thanks 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We can't remove variants without a breaking API change (saved #2171 for later) but we can reduce the expense and size of
Debugon it now.This doesn't do anything for
fn to_strbut that function doesn't have the viral property thatDebughas: if you don't want the strings in that function, just don't call it.fixes #2138