Skip to content

_pop_waiting_trial_id for InMemoryStorage is slow #5948

@not522

Description

@not522

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-fixChange that does not change the behavior, such as code refactoring.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions