-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Rent and return buffer to shared pool per remote message #16838
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
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
🔗 Related Issues
Contributes to #16801 and continuation of #16804
💥 What does this PR do?
Instead of renting a memory at the beginning of BiDi lifecycle, why not to rent it exactly when we need it?
🔧 Implementation Notes
It removes complexity of finalizers.
🔄 Types of changes
PR Type
Enhancement
Description
Rent buffer from pool only when needed in ReceiveAsync
Return buffer immediately after use via try-finally
Remove finalizer and buffer field from class
Simplify disposal logic by eliminating buffer cleanup
Diagram Walkthrough
File Walkthrough
WebSocketTransport.cs
Aggressive buffer pooling with finalizer removaldotnet/src/webdriver/BiDi/WebSocketTransport.cs
_receiveBufferfield and rents buffer locally inReceiveAsyncmethod
pool
~WebSocketTransport) to eliminate complexityDisposemethod by removing buffer cleanup logicreceiveBufferdirectly instead of segmentproperties