Skip to content

remove redundant StopWatch.Stop in SendBroadcastUDPRequest#4102

Open
SimonCropp wants to merge 1 commit intodotnet:mainfrom
SimonCropp:remove-redundant-StopWatch.Stop-in-SendBroadcastUDPRequest
Open

remove redundant StopWatch.Stop in SendBroadcastUDPRequest#4102
SimonCropp wants to merge 1 commit intodotnet:mainfrom
SimonCropp:remove-redundant-StopWatch.Stop-in-SendBroadcastUDPRequest

Conversation

@SimonCropp
Copy link
Copy Markdown
Contributor

if a StopWatch.Elapsed is not use after the StopWatch.Stop, then the stop is redundant perf impact

Copilot AI review requested due to automatic review settings March 29, 2026 11:10
@SimonCropp SimonCropp requested a review from a team as a code owner March 29, 2026 11:10
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes a redundant Stopwatch.Stop() call in SendBroadcastUDPRequest within the Managed SNI SSRP (SQL Server Browser) UDP broadcast discovery path, aiming to reduce unnecessary overhead.

Changes:

  • Replace new Stopwatch(); sw.Start(); with Stopwatch.StartNew().
  • Remove the try/finally block that only existed to call sw.Stop().

@mdaigle mdaigle moved this from To triage to In review in SqlClient Board Apr 1, 2026
@mdaigle mdaigle added this to the 7.1.0-preview1 milestone Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants