Skip to content

Optimize DynamoDBMapper DELETE without empty expected maps - #7391

Closed
RanVaknin wants to merge 1 commit into
aws:feature/master/DDB-mapperv2from
RanVaknin:rvaknin/DELETE-optimization-empty-expected
Closed

RanVaknin wants to merge 1 commit into
aws:feature/master/DDB-mapperv2from
RanVaknin:rvaknin/DELETE-optimization-empty-expected

Conversation

@RanVaknin

Copy link
Copy Markdown
Contributor

Summary

  • Avoid populating DeleteItemRequest.expected when the mapper has no version assertion or user-provided expected conditions.
  • Preserve versioned deletes, condition expressions, expected-value expressions, and conditional operators.
  • Update the golden request fixture for the simple delete path: the request now omits Expected instead of serializing "Expected": {}.

This removes construction and defensive copying of an empty map from the common delete path.

Compatibility

DynamoDB service behavior is unchanged. Code that inspects the low-level request through an interceptor or mock can observe expected() == null instead of an empty map for an unconditional delete.

Testing

  • All 620 DynamoDB Mapper tests passed on the candidate host.
  • Golden request coverage verifies unconditional, versioned, condition-expression, and expected-expression deletes.

Performance

The baseline and candidate ran on separate, equivalently configured c6g.metal hosts using JMH 3-3-2, -prof gc, deterministic stub clients, and the complete 24-case Mapper v2 matrix.

DELETE payload Throughput Allocation
TINY +6.72% -14.86% B/op
SMALL +6.83% -14.86% B/op
HUGE +11.18% -14.86% B/op
HUGE_FLAT +13.43% -14.86% B/op

The full matrix initially showed GET/HUGE_FLAT at -3.08%. A focused 5-5-2 rerun measured 174,830 ops/s for the baseline and 176,162 ops/s for the candidate, a statistically insignificant +0.76%, confirming it was unrelated benchmark noise.

Complete throughput matrix

Benchmark Baseline ops/s Candidate ops/s Change
DELETE / HUGE_FLAT 3,876,820 4,397,470 +13.43%
SCAN / TINY 990,350 1,102,703 +11.35%
DELETE / HUGE 3,600,851 4,003,284 +11.18%
DELETE / SMALL 3,794,745 4,054,061 +6.83%
DELETE / TINY 3,765,409 4,018,593 +6.72%
UPDATE / HUGE_FLAT 58,560 60,889 +3.98%
GET / HUGE_FLAT 180,157 174,600 -3.08%
UPDATE / SMALL 672,137 691,341 +2.86%
UPDATE / TINY 1,337,973 1,375,522 +2.81%
PUT / HUGE_FLAT 93,199 95,419 +2.38%
SCAN / HUGE_FLAT 57,666 58,731 +1.85%
GET / TINY 2,114,996 2,100,916 -0.67%
PUT / TINY 2,077,859 2,065,919 -0.57%
GET / HUGE 145,592 144,870 -0.50%
UPDATE / HUGE 85,982 85,562 -0.49%
QUERY / HUGE 46,975 47,131 +0.33%
PUT / HUGE 93,210 92,961 -0.27%
SCAN / HUGE 49,205 49,292 +0.18%
PUT / SMALL 1,058,703 1,056,992 -0.16%
QUERY / SMALL 419,135 419,679 +0.13%
QUERY / TINY 721,027 721,929 +0.13%
GET / SMALL 1,236,414 1,235,489 -0.07%
SCAN / SMALL 532,499 532,799 +0.06%
QUERY / HUGE_FLAT 56,678 56,654 -0.04%

@RanVaknin
RanVaknin requested a review from a team as a code owner September 22, 2026 07:50
@RanVaknin RanVaknin closed this Sep 22, 2026
@RanVaknin
RanVaknin deleted the rvaknin/DELETE-optimization-empty-expected branch September 22, 2026 22:11
@RanVaknin
RanVaknin restored the rvaknin/DELETE-optimization-empty-expected branch September 22, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant