Skip to content

perf: replace system allocator with tikv-jemallocator to reduce contention (or maybe mimalloc)Β #459

@carabistouflette

Description

@carabistouflette

The project currently uses the default system memory allocator. Generally, when dealing with high-throughput, multithreaded workloads (which Psyche heavily relies on), the system allocator can lead to significant memory fragmentation and lock contention, degrading overall performance.

Rust's default allocator relies on libc's malloc, which is not optimized for the concurrent allocation patterns seen in the heavy async and threaded workloads. jemalloc is an industry standard for such applications (used by TiKV, RocksDB, Redis...) and is known to provide better introspection and performance in these scenarios.

Solution:

Add tikv-jemallocator to

architectures/decentralized/solana-client/Cargo.toml

Register TikvJemallocator as the global allocator in

architectures/decentralized/solana-client/src/main.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions