Skip to content

Cache parsed datasets instead of reopening per frame - #36

Merged
maxburian merged 1 commit into
masterfrom
dataset-cache
Aug 20, 2026
Merged

Cache parsed datasets instead of reopening per frame#36
maxburian merged 1 commit into
masterfrom
dataset-cache

Conversation

@maxburian

Copy link
Copy Markdown
Contributor

Frames of the same dataset share one parsed dataset object and one file mapping. Includes a growth check so a cached entry is discarded if its file has been appended to, and a bound check on chunk addresses. Verified: full test suite green, clean under ThreadSanitizer, byte-identical output on all fixtures, unchanged exported symbols; frame-loop time on a 5000-frame set drops from ~1250 ms to ~240 ms.

Frames of the same dataset now share one parsed dataset object and one
file mapping, published under a mutex and handed out as
shared_ptr<const Dataset>. A cached entry whose file has grown is
discarded before use, and read() refuses a chunk address outside the
mapping. On a 5000-frame test set the frame loop drops from ~1250 ms to
~240 ms.
@maxburian
maxburian merged commit 6b72324 into master Aug 20, 2026
28 checks passed
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