-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet] Avoid performing JSON serialization in debugger display #14734
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Hi @RenderMichael , your statements are absolutely correct. But let me correct main goal: |
I wanted to be more careful, since changing a Maybe the break is acceptable (it should be), but the debugger changes do not lead to any behavior differences at all. |
I understand your motivation, but I don't like a way how it is achieved. We are mixing purposes for debugging, string representation and json serialization. It adds a complexity (which affects maintainability). If we would resolve initial issue with I am afraid I cannot accept this changes in context of "what and how we are trying to resolve it" - for me it is "workaround on top of workaround". Let's wait what others will say. |
For what it’s worth, this debugger display is in line with what other custom debugger displays look like. For example, dictionaries look like this (and these types are basically strongly-typed dictionaries). I agree that without the heavy |
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Inspired by conversion in #14726
Motivation and Context
The debugger display should provide a very brief snapshot of the object's values (the user can expand the object if they want to see everything). Performing JSON serialization is antithetical to that, and can result in performance issues.
Types of changes
Checklist
PR Type
enhancement
Description
DebuggerDisplay
attributes toDriverOptions
,ReturnedCapabilities
, andRemoteSessionSettings
classes to improve debugging experience.GetDebuggerDisplay
methods to provide concise object state information for debugging purposes.reservedSettingNames
fromList
toHashSet
inRemoteSessionSettings
for potential performance improvement.Changes walkthrough 📝
DriverOptions.cs
Add DebuggerDisplay for DriverOptions class
dotnet/src/webdriver/DriverOptions.cs
DebuggerDisplay
attribute toDriverOptions
class.GetDebuggerDisplay
method for concise object staterepresentation.
ReturnedCapabilities.cs
Add DebuggerDisplay for ReturnedCapabilities class
dotnet/src/webdriver/Internal/ReturnedCapabilities.cs
DebuggerDisplay
attribute toReturnedCapabilities
class.GetDebuggerDisplay
method to show browser and capabilitycount.
RemoteSessionSettings.cs
Add DebuggerDisplay and optimize reservedSettingNames in
RemoteSessionSettings
dotnet/src/webdriver/Remote/RemoteSessionSettings.cs
DebuggerDisplay
attribute toRemoteSessionSettings
class.GetDebuggerDisplay
method for displaying browser anddriver count.
reservedSettingNames
fromList
toHashSet
.