ice icon indicating copy to clipboard operation
ice copied to clipboard

IceSSL connection establishment speed: C# vs Java

Open bernardnormier opened this issue 1 year ago • 2 comments

On macos, ssl connection establishment in C# is a lot slower than Java:

% python3 allTests.py Ice/maxConnections --protocol ssl
*** [1/1] Running csharp/Ice/maxConnections tests ***
[ running client/server test - 10/10/24 16:32:03 ]
- Config: ssl
testing the creation of 100 connections... ok
testing the creation of 10 connections with connection lost at 11... ok
testing the creation of 10 connections with connection lost at 11 then recovery... ok

Ran 1 tests in 4.52 seconds
1 succeeded
% python3 allTests.py Ice/maxConnections --protocol ssl
*** [1/1] Running java/Ice/maxConnections tests ***
[ running client/server test - 10/10/24 16:34:34 ]
- Config: ssl
testing the creation of 100 connections... ok
testing the creation of 10 connections with connection lost at 11... ok
testing the creation of 10 connections with connection lost at 11 then recovery... ok

Ran 1 tests in 1.09 seconds
1 succeeded

bernardnormier avatar Oct 10 '24 20:10 bernardnormier

It's actually just as slow in C++:

% python3 allTests.py Ice/maxConnections --protocol ssl
*** [1/1] Running cpp/Ice/maxConnections tests ***
[ running client/server test - 10/10/24 16:55:52 ]
- Config: ssl
testing the creation of 100 connections... ok
testing the creation of 10 connections with connection lost at 11... ok
testing the creation of 10 connections with connection lost at 11 then recovery... ok

Ran 1 tests in 4.59 second

bernardnormier avatar Oct 10 '24 20:10 bernardnormier

Would be good to check if all mappings are picking the same TLS version, and cipher suite, otherwise the comparison is not fair.

pepone avatar Oct 10 '24 20:10 pepone

preliminary testing shows that Java is using TLS 1.3 and C# is using TLS 1.2

pepone avatar Nov 04 '24 19:11 pepone

I think the difference comes from TLS 1.3 vs TLS 1.2

Java supports TLS 1.3 on macOS

.NET does not support TLS 1.3 on macOS see: https://github.com/dotnet/runtime/issues/1979

Ice for C++ has the same issue, we use the old SSL APIs that no longer support using TLS 1.3

pepone avatar Nov 04 '24 20:11 pepone