- Notifications
You must be signed in to change notification settings - Fork311
avoid some allocations when opening a connection#3364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR reduces runtime allocations by pre-building arrays of Azure SQL endpoint strings and refactoring theIsEndpoint
helper to use these arrays instead of concatenating prefixes on each check.
- Introduces
s_azureSqlServerOnDemandEndpoints
for on-demand endpoints. - Changes
IsEndpoint
to accept astring[]
of endpoints. - Updates calls in
IsAzureSynapseOnDemandEndpoint
andIsAzureSqlServerEndpoint
to use the new arrays.
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs:781
- Add unit tests covering each value in
s_azureSqlServerOnDemandEndpoints
to verify thatIsAzureSynapseOnDemandEndpoint
correctly recognizes all intended on-demand endpoints.
internal static readonly string[] s_azureSqlServerOnDemandEndpoints = { ONDEMAND_PREFIX + AZURE_SQL,
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great efficiency win. Just a couple of comments.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@paulmedynski Comments addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks great!
Thanks@vonzshik ! @paulmedynski Possible to get CI running? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #3364 +/- ##==========================================- Coverage 65.10% 61.39% -3.72%========================================== Files 300 294 -6 Lines 65376 65071 -305 ==========================================- Hits 42565 39949 -2616- Misses 22811 25122 +2311
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@cheenamalhotra@paulmedynski PR updated |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
@Wraith2 Thanks, tests (and bugs) fixed. |
@cheenamalhotra@paulmedynski Could you please help with CI? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
1b07f8b
intodotnet:mainUh oh!
There was an error while loading.Please reload this page.
fixes#3363