Skip to content

perf: ensure partial cache can be re-used also when stop_index is None#413

Merged
efredriksson-modelon merged 1 commit into
masterfrom
dev-ef-faster-do-many-get-variable-data
Jun 1, 2026
Merged

perf: ensure partial cache can be re-used also when stop_index is None#413
efredriksson-modelon merged 1 commit into
masterfrom
dev-ef-faster-do-many-get-variable-data

Conversation

@efredriksson-modelon
Copy link
Copy Markdown
Collaborator

This MR is to speedup when using get_variable_data method without any pagination. The main speedup is to not have to re-read the time vectors for each call.

Motivation

The original guard rejected all stop_index=None cache hits. That was overly broad: it correctly blocked a partial cache being returned as a full trajectory, but it also unnecessarily blocked a genuine full trajectory in cache from being reused. The fix narrows the rejection to only the case that actually matters — cached length doesn't match the total number of available points — which is the precise condition under which returning the cache would truncate the result.

Comment thread src/common/io.py Outdated
@efredriksson-modelon efredriksson-modelon force-pushed the dev-ef-faster-do-many-get-variable-data branch from ff17257 to b438bf5 Compare June 1, 2026 11:59
@efredriksson-modelon efredriksson-modelon merged commit 67d63ff into master Jun 1, 2026
2 checks passed
@efredriksson-modelon efredriksson-modelon deleted the dev-ef-faster-do-many-get-variable-data branch June 1, 2026 12:24
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.

2 participants