add more TLS handshake test variations #1210
Merged
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.
This is a follow-up on #1146 as I was trying to explain some observed discrepancies - primarily on Linux. The "Default" handshake uses 4K RSA key so it should be comparable to TLS12HandshakeRSA4096CertAsync on platforms without TLS1.3. For some reason using NetwrokStream with TCP is MUCH slower on Linux. I would expect pipe to be somewhat more efficient but not as much as observed.
DefaultHandshake may not be directly comparable across platforms as the setting may be different but it shows what we can do in the default setting.
Windows:
All Stream types are similar, TLS12 is slower because
NewGuid()
prevents TLS resume.Now, on comparable Ubuntu machine:
Doing the same work over NetworkStream is MUCH slower. This is on the already connected socket so the cost of TCP handshake should not matter.
For comparison, when I run this with experimental TLS resume code I get:
On Pipe the time goes from 7.2 -> 1.9 but TCP still steys pretty high -> much higher then the cost of crypto.
cc: @alnikola @tmds @stephentoub @adamsitnik