Skip to content

Use mimalloc v3 - #21014

Open
chirizxc wants to merge 1 commit into
astral-sh:mainfrom
chirizxc:patch-1
Open

chirizxc wants to merge 1 commit into
astral-sh:mainfrom
chirizxc:patch-1

Conversation

@chirizxc

@chirizxc chirizxc commented Aug 9, 2026 •

Copy link
Copy Markdown

Updated mimalloc dependency version for Windows target.
Comment on lines 19 to 20
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), not(target_os = "freebsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dependencies]
tikv-jemallocator = { version = "0.6.0" }

@chirizxc chirizxc Aug 9, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth make these as features to avoid such long conditions and their duplication in the file?

@charliermarsh

Copy link
Copy Markdown
Member

This makes sense given that we've now merged it in Ruff, but I'll let @zanieb merge since they looked at the issue last time.

@zanieb

zanieb commented Aug 11, 2026

Copy link
Copy Markdown
Member

My prior research on this was not compelling and showed memory use regressions that were hard to offset with configuration; it's a bit messy, but see #19743

@chirizxc

chirizxc commented Aug 11, 2026 •

Copy link
Copy Markdown
Author

My prior research on this was not compelling and showed memory use regressions that were hard to offset with configuration; it's a bit messy, but see #19743

On my machine, memory usage for ruff actually decreased (i used this script: astral-sh/ruff#27586 (comment))

@zanieb

zanieb commented Aug 11, 2026

Copy link
Copy Markdown
Member

Ruff is really different than uv, we'd need benchmarks for this project.

@zanieb

zanieb commented Aug 11, 2026

Copy link
Copy Markdown
Member

I can still reproduce the cold resolve memory regressions:

  • home-assistant-core: 85.23 → 113.67 MiB, +33.37%.
  • airflow: 177.20 → 229.36 MiB, +29.43%.
  • bio-embeddings: 93.57 → 119.23 MiB, +27.43%.
  • saleor: 89.87 → 113.76 MiB, +26.59%.

@chirizxc

Copy link
Copy Markdown
Author

I can still reproduce the cold resolve memory regressions:

* home-assistant-core: 85.23 → 113.67 MiB, +33.37%.

* airflow: 177.20 → 229.36 MiB, +29.43%.

* bio-embeddings: 93.57 → 119.23 MiB, +27.43%.

* saleor: 89.87 → 113.76 MiB, +26.59%.

Could you share your script? I'll run it locally on my computer.

@zanieb

zanieb commented Aug 11, 2026

Copy link
Copy Markdown
Member

@chirizxc

Copy link
Copy Markdown
Author

Sure, it's just generated by Codex zb/pr-21014-mimalloc-namespace-bench-20260811/.github/scripts/mimalloc-high-confidence-rss.ps1

Yeah, I think I was able to reproduce it locally

@chirizxc

chirizxc commented Aug 12, 2026 •

Copy link
Copy Markdown
Author

Sure, it's just generated by Codex zb/pr-21014-mimalloc-namespace-bench-20260811/.github/scripts/mimalloc-high-confidence-rss.ps1

As I understand it, you're running this benchmark on GitHub Windows Runner?

upd. If it's not too much trouble, just for the sake of the test, could you also add https://github.com/moggedhedien/rimalloc to this bench?

@zanieb

zanieb commented Aug 12, 2026

Copy link
Copy Markdown
Member

I was running it on a Namespace VM

@zanieb

zanieb commented Aug 12, 2026

Copy link
Copy Markdown
Member

rimalloc doesn't have Windows support, it seems

@chirizxc

Copy link
Copy Markdown
Author

I've also tested several Rust projects using snmalloc, but it was usually slower

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows aarch64 smoke test fails with EXCEPTION_ACCESS_VIOLATION on mimalloc v3

3 participants