Parent issue: #5747
Problem
PartitionRoutingHelper (src/Routing/PartitionRoutingHelper.cs) accesses PartitionKeyRange.MinInclusive and .MaxExclusive at lines 268, 377, and 379 during partition split handling and continuation token processing. Each access triggers JToken.ToObject<T>() deserialization.
Hot path assessment: WARM
Called per-query when resuming from continuation tokens or handling partition splits. Not per-item, but can be frequent in high-throughput query scenarios with many partitions.
Suggested fix
Cache the property values in local variables before use, or leverage Range<string> objects that already contain materialized Min/Max strings.
Lines
PartitionRoutingHelper.cs:268 replacedRanges[0].MinInclusive and replacedRanges[...].MaxExclusive in validation
PartitionRoutingHelper.cs:377 currentRange.MaxExclusive in comparison
PartitionRoutingHelper.cs:379 currentRange.MaxExclusive repeated access
Constraint
PartitionKeyRange is in compiled NuGet (Microsoft.Azure.Cosmos.Direct) fix must be at the call site.
Parent issue: #5747
Problem
PartitionRoutingHelper(src/Routing/PartitionRoutingHelper.cs) accessesPartitionKeyRange.MinInclusiveand.MaxExclusiveat lines 268, 377, and 379 during partition split handling and continuation token processing. Each access triggersJToken.ToObject<T>()deserialization.Hot path assessment: WARM
Called per-query when resuming from continuation tokens or handling partition splits. Not per-item, but can be frequent in high-throughput query scenarios with many partitions.
Suggested fix
Cache the property values in local variables before use, or leverage
Range<string>objects that already contain materialized Min/Max strings.Lines
PartitionRoutingHelper.cs:268replacedRanges[0].MinInclusiveandreplacedRanges[...].MaxExclusivein validationPartitionRoutingHelper.cs:377currentRange.MaxExclusivein comparisonPartitionRoutingHelper.cs:379currentRange.MaxExclusiverepeated accessConstraint
PartitionKeyRangeis in compiled NuGet (Microsoft.Azure.Cosmos.Direct) fix must be at the call site.