Skip to content

Use mimalloc for musl builds#147

Open
jssblck wants to merge 5 commits into
mainfrom
jess/chore/mimalloc
Open

Use mimalloc for musl builds#147
jssblck wants to merge 5 commits into
mainfrom
jess/chore/mimalloc

Conversation

@jssblck

@jssblck jssblck commented Oct 28, 2025

Copy link
Copy Markdown
Member

I was reminded of this when reading reddit before work this morning: https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/

We do musl builds as part of our current release process, and we care about performance a lot, so...

@jssblck jssblck requested review from Copilot and elldritch October 28, 2025 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates mimalloc as the global allocator for musl-based builds to address performance issues with musl's default allocator. The change affects both the hurry and courier packages, which are built for musl targets as part of the release process.

Key changes:

  • Added mimalloc as a conditional dependency for musl targets in both hurry and courier packages
  • Configured mimalloc as the global allocator when building for musl environments
  • Consolidated workspace dependency declarations by moving is_executable and directories to the workspace root

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

File Description
packages/hurry/Cargo.toml Added mimalloc dependency for musl targets; migrated dependencies to workspace
packages/courier/Cargo.toml Added mimalloc dependency for musl targets
packages/courier/src/main.rs Set mimalloc as global allocator for musl builds
Cargo.toml Added workspace-level dependency declarations for is_executable and directories

Comment thread packages/courier/src/main.rs Outdated
@elldritch

Copy link
Copy Markdown
Contributor

What does performance look like before and after this change on your machine?

@jssblck

jssblck commented Oct 29, 2025

Copy link
Copy Markdown
Member Author

What does performance look like before and after this change on your machine?

@elldritch this was more of a proactive change than a reactive one. I've definitely profiled applications in the past where this made a large difference. I can get numbers if you'd like but I do think this is a pretty low-risk high-impact change.

@jssblck

jssblck commented Oct 29, 2025

Copy link
Copy Markdown
Member Author

I plan to revisit this once the CLI is a bit more stable, putting this on ice for now

@jssblck jssblck removed the request for review from elldritch October 29, 2025 18:09
@jssblck jssblck added the on ice Not being actively worked on, but not something we want to delete just yet. label Oct 29, 2025
@jssblck jssblck self-assigned this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on ice Not being actively worked on, but not something we want to delete just yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants