Skip to content

Offer different allocator options for building Cargo itself #15171

Open
@weihanglo

Description

Problem

In #14691, some benchmarks show that using jemalloc or mimalloc boosts Cargo's performance. There is a discussion on Zulip about whether we should switch to a different allocator. However, there are concerns raised, such as the risk of changing the allocator on some platforms. Besides, allocations are not the largest contributor to Cargo's invocation time—algorithms in dependency resolution play a more significant role. It might not be worth the risk.

This issue is open for collecting feedback and use cases.

Proposed Solution

Do something like #14691 adding different Cargo feature to enable different allocators for downstream packagers.

Notes

No response

Metadata

Assignees

No one assigned

    Labels

    A-cargo-apiArea: cargo-the-library API and internal code issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`PerformanceGotta go fast!S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions