Skip to content

Worse memory usage than old stdlib hashmap due to growth factor differences. #304

@emilio

Description

@emilio

Hi,

So, in https://bugzilla.mozilla.org/show_bug.cgi?id=1747037, I'm investigating a memory usage regression that happened when removing our old fork of the stdlib hashmap (which we needed for various reasons, mostly fallible allocations) in favor of the new stdlib hashmap.

During the investigation, I found the underlying cause is just the growth factor choices. If I'm reading the code correctly, to allocate a enough capacity for a new capacity:

I understand there are various trade-offs involved and this might just be by design, but it's not obvious to me from reading the code this is the intended behavior, so filing just in case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions