Skip to content

Grow arrays by a factor less than 2? #8269

Closed

Description

I recently discovered this document in one of FB’s open source libraries for C++: https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md

It makes an interesting argument for growing arrays by a factor smaller than 2 when resizing them so that you can reuse memory more easily. Not sure how much you also need to use a custom malloc routine to get the benefits being claimed, but I thought I'd raise the idea in case we can get any performance enhancements from these ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    performanceMust go fasterspeculativeWhether the change will be implemented is speculative

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions