-
Notifications
You must be signed in to change notification settings - Fork 494
UnreferenceDisposable made slimmer #627
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
UnreferenceDisposable made slimmer #627
Conversation
Not sure I understand how this is made smaller? It's adding a property when previously only a field was being used. |
|
When you say references, I presume you mean constructor parameters? While your changes are removing one parameter, they are also introducing a property getter in the containing class, so from an IL size perspective this is probably increasing it rather than decreasing it. |
I mean the underlying fields created behind the scenes. Before this PR there are two fields in |
I see, thanks. |
…7897) Updated [ModelContextProtocol](https://github.com/modelcontextprotocol/csharp-sdk) from 0.3.0-preview.2 to 0.3.0-preview.4. <details> <summary>Release notes</summary> _Sourced from [ModelContextProtocol's releases](https://github.com/modelcontextprotocol/csharp-sdk/releases)._ ## 0.3.0-preview.4 ## What's Changed * Respect HandleResponse() and SkipHandler() calls in OnResourceMetadataRequest by @halter73 in modelcontextprotocol/csharp-sdk#607 * UnreferenceDisposable made slimmer by @Scooletz in modelcontextprotocol/csharp-sdk#627 * IdleTracking uses lists instead of SortedSet by @Scooletz in modelcontextprotocol/csharp-sdk#629 * Fix ResourceLinkBlock deserialization by adding missing "name" case by @Copilot in modelcontextprotocol/csharp-sdk#645 * Add an in-memory transport sample by @stephentoub in modelcontextprotocol/csharp-sdk#664 * Remove 'Sse' from AspNetCoreSseServer sample name by @halter73 in modelcontextprotocol/csharp-sdk#665 * Fix NotSupportedException when returning IEnumerable<ContentBlock> by @Copilot in modelcontextprotocol/csharp-sdk#675 * Enhance HTTP and MCP session logging by @theojiang25 in modelcontextprotocol/csharp-sdk#608 * Remove special-casing of string enumerables in McpServerTool by @stephentoub in modelcontextprotocol/csharp-sdk#699 * Prune idle sessions before starting new ones by @halter73 in modelcontextprotocol/csharp-sdk#701 * Add framework for conceptual docs by @mikekistler in modelcontextprotocol/csharp-sdk#708 ## New Contributors * @Scooletz made their first contribution in modelcontextprotocol/csharp-sdk#627 * @Copilot made their first contribution in modelcontextprotocol/csharp-sdk#645 * @theojiang25 made their first contribution in modelcontextprotocol/csharp-sdk#608 **Full Changelog**: modelcontextprotocol/csharp-sdk@v0.3.0-preview.3...v0.3.0-preview.4 ## 0.3.0-preview.3 ## What's Changed * Enable netfx testing. by @eiriktsarpalis in modelcontextprotocol/csharp-sdk#588 * fix: Prevent crash when Options.ResourceMetadata is null but handled by event by @DavidParks8 in modelcontextprotocol/csharp-sdk#603 * Update to M.E.AI 9.7.0 by @stephentoub in modelcontextprotocol/csharp-sdk#602 * Ensure IsExternalInit is type forwarded on NET builds by @stephentoub in modelcontextprotocol/csharp-sdk#619 * Flow ExecutionContext with JsonRpcMessage by @halter73 in modelcontextprotocol/csharp-sdk#616 * Update MEAI version and add regression test for #601. by @eiriktsarpalis in modelcontextprotocol/csharp-sdk#628 ## New Contributors * @DavidParks8 made their first contribution in modelcontextprotocol/csharp-sdk#603 **Full Changelog**: modelcontextprotocol/csharp-sdk@v0.3.0-preview.2...v0.3.0-preview.3 Commits viewable in [compare view](modelcontextprotocol/csharp-sdk@v0.3.0-preview.2...v0.3.0-preview.4). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/17897) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
A minor adjustement in
UnreferenceDisposable
so that it's smaller.UnreferenceDisposable
had two references previously. One for the session, one for the time provider. Now it has one so wheneverUnreferenceDisposable
is created for scoping, the allocated object has one less reference to capture.Motivation and Context
Going through the project and finding optimization opportunities.
How Has This Been Tested?
Locally, unit tests.
Breaking Changes
Nope
Types of changes
Checklist