Open
Description
Every time you create a new instance of SqlConnection
, if the connection string's RetryCount
is equal to 1 (which is the default value) SqlClient will attempt to subtly replace it with 5 if it determines that the host is azure synapse on demand endpoint.
The problem is that to determine that SqlClient concats prefix -ondemand
with a collection of specific endpoints and then checks whether the host contains any endpoint. With 5 endpoints, that's 5 string allocations per each instance of SqlConnection
, which in a simple benchmark results in about 40% of total allocations.
Maybe it's better to instantiate them once just like it's done for azure sql server endpoints?