[ty] Use jemalloc on linux by MichaReiser · Pull Request #21975 · astral-sh/ruff (original) (raw)
added 2 commits
Copy Ruff's platform-specific allocator configuration to ty:
- Windows: uses mimalloc
- Unix-like (x86_64, aarch64, powerpc64, riscv64): uses jemalloc by default
- Other platforms: uses system allocator
Add
mimallocfeature flag to prefer mimalloc over jemalloc on platforms that support both allocatorsAdd allocator memory usage statistics:
- Set TY_ALLOCATOR_STATS=1 to print memory stats on exit
- jemalloc: shows allocated, active, resident, mapped, retained, metadata bytes and fragmentation percentage
- mimalloc: provides guidance for using MIMALLOC_SHOW_STATS=1
Add tikv-jemalloc-ctl workspace dependency with stats feature
Add comprehensive documentation to the allocator module explaining:
- TY_ALLOCATOR_STATS=1 for built-in stats output
- MALLOC_CONF=stats_print:true for detailed jemalloc stats
- stats_print_opts flags for jemalloc (g, m, d, a, b, l, x)
- MIMALLOC_SHOW_STATS=1 and MIMALLOC_VERBOSE=1 for mimalloc
Also update the jemalloc stats output to include a tip about MALLOC_CONF for users wanting more detailed information.
Update allocator configuration so that:
- No feature flags: use system allocator (default)
- --features jemalloc: use jemalloc on supported platforms
- --features mimalloc: use mimalloc on all platforms
- Both features enabled: jemalloc on supported platforms, mimalloc elsewhere
This makes it easy to compare allocator performance by simply changing the feature flags during build.
MichaReiser changed the title
[ty] Use custom allocator [ty] Use jemalloc on linux
MichaReiser deleted the claude/custom-allocators-mimalloc-01VFGzka5wDLFvvNY9bHrHgG branch
dcreager added a commit that referenced this pull request
- origin/main:
Fluent formatting of method chains (#21369)
[ty] Avoid stack overflow when calculating inferable typevars (#21971)
[ty] Add "qualify ..." code fix for undefined references (#21968)
[ty] Use jemalloc on linux (#21975)
Update MSRV to 1.90 (#21987)
[ty] Improve check enforcing that an overloaded function must have an implementation (#21978)
Update actions/checkout digest to 8e8c483 (#21982)
[ty] Use
ParamSpecwithout the attr for inferable check (#21934) [ty] Emit diagnostic when a type variable with a default is followed by one without a default (#21787)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})