Skip to content

ConfigOptions creation is slow #3295

@crepererum

Description

@crepererum

Describe the bug
ConfigOptions::new and ConfigOptions::from_env grow their internal HashMap during creation even though they know that size beforehand.

To Reproduce
Create ConfigOption very often, attach a sampling profiler.

Expected behavior
Be efficient, use HashMap::with_capacity.

Additional context
Nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions