-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
_pop_waiting_trial_id for InMemoryStorage is slow #5948
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
_pop_waiting_trial_id for InMemoryStorage becomes slow with a large number of trials. We can increase the speed with caching the number of the previous trial with waiting state.
The main cause of this issue is below.
optuna/optuna/storages/_in_memory.py
Line 380 in 229fe58
| trials = [t for t in trials if t.state in states] |
ref: #4716
Suggestion
We can introduce something like previous_waiting_trial_number to cache the number of the previous waiting trial.
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.