Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve async string perf and fix reading chars with initial offset.#3377

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

Merged
mdaigle merged 7 commits intodotnet:mainfromWraith2:fix-3274
Jun 4, 2025

Conversation

Wraith2
Copy link
Contributor

Description

For performance related changes see background information in#3274 (comment) and the preceeding conversation. Reading a string in async mode was being slower than expected so I investigated. I will annotate each change with an explanation.

Issues

fixes#3331
fixes#3274

Testing

Tests have been added which cover both issues that are being fixed.

rogihee reacted with hooray emoji
@Wraith2Wraith2 requested a review froma team as acode ownerMay 26, 2025 20:26
@Wraith2
Copy link
ContributorAuthor

Wraith2 commentedMay 26, 2025
edited
Loading

/cc@Tornhoof,@AlexanderKot this should fix your issues.

@dotnet/sqlclientdevteam can I get a CI kick? I'd really really like to get this in to preview 2 because it fixes all the known issues with async continue.

cheenamalhotra, AlexanderKot, Tornhoof, and ericsampson reacted with thumbs up emoji

@cheenamalhotra
Copy link
Member

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@codecovCodecov
Copy link

codecovbot commentedMay 27, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is0% with12 lines in your changes missing coverage. Please review.

Project coverage is 59.71%. Comparing base(b8948f2) to head(e8df89e).
Report is 15 commits behind head on main.

Files with missing linesPatch %Lines
...nt/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs0.00%6 Missing⚠️
.../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs0.00%5 Missing⚠️
...c/Microsoft/Data/SqlClient/TdsParserStateObject.cs0.00%1 Missing⚠️

❗ There is a different number of reports uploaded between BASE (b8948f2) and HEAD (e8df89e). Click for more details.

HEAD has 1 upload less than BASE
FlagBASE (b8948f2)HEAD (e8df89e)
addons10
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3377      +/-   ##==========================================- Coverage   67.04%   59.71%   -7.33%==========================================  Files         300      293       -7       Lines       65376    65308      -68     ==========================================- Hits        43831    39000    -4831- Misses      21545    26308    +4763
FlagCoverage Δ
addons?
netcore63.02% <0.00%> (-9.17%)⬇️
netfx61.03% <0.00%> (-4.15%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheenamalhotracheenamalhotra added this to the6.1-preview2 milestoneMay 27, 2025
Copy link
Contributor

@CopilotCopilotAI 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

This PR targets performance improvements in asynchronous string processing and corrects an issue with reading characters using an initial offset.

  • Added a new sequential character reading test ("CanGetCharsSequentially") to verify correct behavior.
  • Introduced helper methods in tests to use pooled buffers, ensuring buffers are resized appropriately.
  • Updated buffer management logic in TdsParser (both netfx and netcore) to use the correct offset and to improve buffer reallocation efficiency.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

FileDescription
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderTest.csAdds a new test and helper method for sequential character reading using pooled buffers.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.csIntroduces a GetPacketSize() method and a property to calculate the current packet index.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.csAdjusts buffer sizing logic and offset handling to improve performance and correctness.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.csMirrors changes in netfx for improved buffer management and offset accumulation.

@cheenamalhotracheenamalhotra requested a review froma teamMay 27, 2025 17:23
@cheenamalhotra
Copy link
Member

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

paulmedynski
paulmedynski previously approved these changesMay 29, 2025
@mdaiglemdaigle self-assigned thisMay 29, 2025
Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

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

I can't say I know much about the internals here, so I appreciate the callouts on what changes are being made. However, I'm not understanding what the _longlen changes are really doing. Please take a look at my comments and I'll approve if you can explain it without code changes :)

@paulmedynski
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mdaigle
Copy link
Contributor

@benrr101 this one needs an updated review from you

Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes!

@mdaiglemdaigle merged commit05df554 intodotnet:mainJun 4, 2025
237 checks passed
@Wraith2Wraith2 deleted the fix-3274 branchJune 5, 2025 23:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ericsampsonericsampsonericsampson left review comments

@mdaiglemdaiglemdaigle approved these changes

@cheenamalhotracheenamalhotracheenamalhotra left review comments

Copilot code reviewCopilotCopilot left review comments

@benrr101benrr101benrr101 approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

Assignees

@mdaiglemdaigle

Labels
None yet
Projects
None yet
Milestone
6.1-preview2
6 participants
@Wraith2@cheenamalhotra@paulmedynski@mdaigle@benrr101@ericsampson

[8]ページ先頭

©2009-2025 Movatter.jp