Skip to content

Commit 4c20975

Browse files
ReubenBondCopilot
andcommitted
perf: fast-path canonical grain manifests
Avoid re-deduplicating grain manifests which are already known canonical while preserving the fallback for equivalent unseen manifests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 076ee44 commit 4c20975

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Orleans.Core.Abstractions/Manifest/ClusterManifest.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,17 @@ private static (ImmutableDictionary<SiloAddress, GrainManifest> Silos, Immutable
102102

103103
GrainManifest GetCanonicalManifest(GrainManifest manifest)
104104
{
105-
manifest = DeduplicateManifest(manifest);
106105
if (canonicalManifests.TryGetValue(manifest, out var canonicalManifest))
107106
{
108107
return canonicalManifest;
109108
}
110109

110+
manifest = DeduplicateManifest(manifest);
111+
if (canonicalManifests.TryGetValue(manifest, out canonicalManifest))
112+
{
113+
return canonicalManifest;
114+
}
115+
111116
canonicalManifests.Add(manifest, manifest);
112117
uniqueManifests.Add(manifest);
113118
return manifest;

0 commit comments

Comments
 (0)