Skip to content

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

Open
efredriksson-modelon wants to merge 1 commit into
masterfrom
dev-ef-faster-do-many-get-variable-data
Open

perf: ensure partial cache can be re-used also when stop_index is None#413
efredriksson-modelon wants to merge 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.

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