[dotnet] [bidi] Optimize processing of incoming messages#17206
Merged
nvborisenko merged 5 commits intoSeleniumHQ:trunkfrom Mar 11, 2026
Merged
[dotnet] [bidi] Optimize processing of incoming messages#17206nvborisenko merged 5 commits intoSeleniumHQ:trunkfrom
nvborisenko merged 5 commits intoSeleniumHQ:trunkfrom
Conversation
Contributor
Review Summary by QodoOptimize BiDi message processing with improved property parsing
WalkthroughsDescription• Refactored property parsing from switch statement to if-else chain using ValueTextEquals() • Changed paramsStartIndex and paramsEndIndex from long to int for type consistency • Optimized JSON reader initialization by removing unnecessary ReadOnlySpan<byte> wrapper • Fixed parameter index calculation to correctly capture token positions File Changes1. dotnet/src/webdriver/BiDi/Broker.cs
|
Contributor
Code Review by Qodo
1. ProcessReceivedMessage changes lack tests
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors Broker.ProcessReceivedMessage in the .NET BiDi implementation to reduce allocations and simplify JSON property handling while ensuring parameter byte indices are handled consistently for slicing the raw params payload.
Changes:
- Replaced string-based property name parsing with
Utf8JsonReader.ValueTextEquals(...)using UTF-8 literals. - Standardized
paramsstart/end indices tointand simplifiedReadOnlyMemory<byte>slicing for event params.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the
ProcessReceivedMessagemethod inBroker.csto improve the parsing logic for JSON properties and to fix type inconsistencies relating to parameter indices. The changes streamline property handling and ensure correct indexing for extracting parameter data.🔄 Types of changes