Repository navigation
perf: avoid caching camera payloads during frame extraction - #689
Merged
kstonekuan merged 2 commits intoOct 5, 2026
Merged
Conversation
Contributor
|
kstonekuan
approved these changes
Oct 5, 2026
kstonekuan
left a comment
Contributor
There was a problem hiding this comment.
LGTM, merging. Thanks.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Episode.frames()andframes_at_indices()now collect timestamps from batches withoutretaining the camera payloads. If the channel is already cached, they reuse its
timestamps.
The timestamp mapper also accepts NumPy arrays directly, avoiding an extra
.tolist()allocation.
Fixes #687.
Why
Both methods previously loaded and cached the entire camera channel just to access
timestamps. This could retain a large amount of encoded video during frame extraction.
This change preserves frame selection and returned timestamps. Tests cover unchanged log
times, cache preservation, and reuse of preloaded channels.
Validation
uv run --no-sync pytest -q tests/test_end_to_end.py tests/test_episode.py tests/ test_video.py tests/test_video_streaming.py tests/test_video_malformed_guards.py— 105passed.
uv run --no-sync pytest -q— 2,513 passed, 9 skipped, 1 failed.test_legacy_cache_migration_merges_without_overwriting, also reproduceson unchanged upstream code.
uv run --no-sync ruff check --fix— passed.uv run --no-sync ruff format— passed.uv run --no-sync ty check— passed.git diff --check— passed.No benchmark was added, as agreed in the issue discussion.
Checklist