Skip to content

[dotnet] [bidi] Avoid massive command descriptors allocation - #17965

Merged
nvborisenko merged 1 commit into
SeleniumHQ:trunkfrom
nvborisenko:bidi-avoid-massive-commands-init
Aug 28, 2026
Merged

[dotnet] [bidi] Avoid massive command descriptors allocation#17965
nvborisenko merged 1 commit into
SeleniumHQ:trunkfrom
nvborisenko:bidi-avoid-massive-commands-init

Conversation

@nvborisenko

Copy link
Copy Markdown
Member

Improve performance.

🔗 Related Issues

When we access bidi.Network then all commands are statically allocated. We can do better.

💥 What does this PR do?

Inline necessary commands info at caller side without any allocations.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s):
    • What was generated:
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Breaking change (for custom modules)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@selenium-ci selenium-ci added the C-dotnet .NET Bindings label Aug 28, 2026
@nvborisenko
nvborisenko requested a balanced review from Copilot August 28, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Optimizes .NET BiDi module initialization by passing command metadata directly to the broker instead of eagerly creating static descriptors.

Changes:

  • Replaces static command descriptors with inline method and JSON metadata.
  • Refactors Module and Broker command execution APIs.
  • Updates the custom-module test; however, the public API removal lacks deprecation compatibility.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dotnet/test/webdriver/BiDi/Session/SessionTests.cs Updates custom-module command execution.
dotnet/src/webdriver/BiDi/WebExtension/WebExtensionModule.cs Inlines WebExtension metadata.
dotnet/src/webdriver/BiDi/Storage/StorageModule.cs Inlines Storage metadata.
dotnet/src/webdriver/BiDi/Session/SessionModule.cs Inlines Session metadata.
dotnet/src/webdriver/BiDi/Script/ScriptModule.cs Inlines Script metadata.
dotnet/src/webdriver/BiDi/Permissions/PermissionsModule.cs Inlines Permissions metadata.
dotnet/src/webdriver/BiDi/Network/NetworkModule.cs Removes eagerly initialized Network descriptors.
dotnet/src/webdriver/BiDi/Module.cs Changes the protected execution API.
dotnet/src/webdriver/BiDi/Input/InputModule.cs Inlines Input metadata.
dotnet/src/webdriver/BiDi/Emulation/EmulationModule.cs Inlines Emulation metadata.
dotnet/src/webdriver/BiDi/Command.cs Removes the public command descriptor type.
dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs Inlines browsing-context metadata.
dotnet/src/webdriver/BiDi/Browser/BrowserModule.cs Inlines Browser metadata.
dotnet/src/webdriver/BiDi/Broker.cs Accepts flattened command metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dotnet/src/webdriver/BiDi/Module.cs
@nvborisenko

Copy link
Copy Markdown
Member Author

Good improvement, thanks.

@nvborisenko
nvborisenko merged commit f11ced3 into SeleniumHQ:trunk Aug 28, 2026
25 checks passed
@nvborisenko
nvborisenko deleted the bidi-avoid-massive-commands-init branch August 28, 2026 17:29
This was referenced Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-dotnet .NET Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants