-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
IntersectionSearchSpace is slow #5949
Copy link
Copy link
Closed
Labels
code-fixChange that does not change the behavior, such as code refactoring.Change that does not change the behavior, such as code refactoring.
Description
Motivation
The time complexity of IntersectionSearchSpace is O(n_trials) for each trial. We can improve it to the constant time.
We filter trials here, but we can do it in the following for-loop.
| trials_of_interest = [trial for trial in trials if trial.state in states_of_interest] |
Suggestion
We can move the filtering to the inside of the for-loop. The loop will finish immediately using cached_trial_number.
Additional context (optional)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
code-fixChange that does not change the behavior, such as code refactoring.Change that does not change the behavior, such as code refactoring.