aws / aws/aws-durable-execution-sdk-python
[Feature]: Deduplicate SerDes deserialization within an invocation
- Ngôn ngữ chính
- Python
- Star
- 53
- Fork
- 25
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 40
Mô tả
## What would you like?
Deduplicate repeated SerDes deserialization within a single Lambda invocation.
Context-dependent SerDes implementations may perform filesystem or network I/O. Repeated access to the same checkpointed result or exception currently invokes the configured SerDes again, even when the serialized input and durable payload identity are unchanged.
## Possible Implementation
- Add an invocation-scoped deserialization cache around SDK-managed SerDes calls.
- Key entries by SerDes instance identity, durable execution ARN, operation/entity identity, payload kind when available, and a digest of the serialized input.
- Cache successful values, including `None`, but never cache failures.
- Bound completed entries with an LRU or weak-reference policy so large deserialized values are not retained indefinitely.
- If SDK-managed child/concurrency threads can request the same value concurrently, share one in-flight result rather than issuing duplicate external reads.
- Clear all entries at the end of the Lambda invocation; do not use a process-global cache across replays.
- Add tests for cache hits, distinct contexts/data, `None`, failures, eviction, and concurrent callers.
## Is this a breaking change?
No.
## Does this require an RFC?
No.
## Additional Context
This is primarily valuable for filesystem and other external-storage SerDes implementations. The Java SDK work in aws/aws-durable-execution-sdk-java#648 uses an invocation-scoped bounded cache and in-flight deduplication.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định các lệnh gọi SerDes do SDK quản lý và vòng đời invocation của Lambda, nơi có thể thiết lập và xóa một cache theo phạm vi invocation. Thêm các kiểm thử bao quát cache hit, các context và dữ liệu khác nhau, giá trị None, lỗi, eviction và các caller đồng thời; hoàn thành có nghĩa là các request khớp lặp lại được loại bỏ trùng lặp mà không cache lỗi hoặc vượt qua ranh giới invocation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend, cloud
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100