Skip to content

perf(redis): avoid serializing addresses during unregister - #10835

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-perf-reduce-hot-path-allocations
Aug 26, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-perf-reduce-hot-path-allocations

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Redis grain-directory unregister operations serialized the full GrainAddress even though the delete script only consumes its activation ID. This removes that unused serialization.

Rationale

Unregister remains activation-aware and preserves conflict handling while avoiding a JSON string allocation and serialization work on every successful call.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings August 26, 2026 08:06

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

This PR optimizes the Redis grain-directory unregister path by removing an unnecessary JSON serialization of the full GrainAddress when the Redis delete script only needs the activation id, reducing per-call allocation and serialization overhead in the common success case.

Changes:

  • Remove eager JsonSerializer.Serialize(address) allocation during Unregister.
  • Continue passing only ActivationId into the Redis delete script while preserving conflict handling behavior.
Show a summary per file
File Description
src/Redis/Orleans.GrainDirectory.Redis/RedisGrainDirectory.cs Removes unused address serialization in Unregister and keeps the script invocation based on activation id.

Review details

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

77.61% line coverage - 97,578 / 125,721 lines

Coverage details

@ReubenBond
ReubenBond merged commit 1c276fd into dotnet:main Aug 26, 2026
76 checks passed
@ReubenBond
ReubenBond deleted the rb-perf-reduce-hot-path-allocations branch August 26, 2026 14:22
This was referenced Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants