Skip to content

Make mimalloc the default for fully static musl builds#2248

Open
henderkes wants to merge 1 commit intomainfrom
feat/mimalloc-default
Open

Make mimalloc the default for fully static musl builds#2248
henderkes wants to merge 1 commit intomainfrom
feat/mimalloc-default

Conversation

@henderkes
Copy link
Contributor

@henderkes henderkes commented Mar 7, 2026

Thank ctrl + shift + F.

closes #2246

@henderkes henderkes requested a review from dunglas March 7, 2026 04:57
Comment on lines +41 to +43
if [ -z "${MIMALLOC}" ]; then
MIMALLOC=1
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to go this route so that people using the static builder themselves also get mimalloc by default. Other option was to change the default in our matrix.

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Maybe could we also enable mimalloc in our Docker images too, or explain how to use it with Docker in the docs?

docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp ; docker rm static-builder-musl
```

For better performance in heavily concurrent scenarios, consider using the [mimalloc](https://github.com/microsoft/mimalloc) allocator.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe explain now to disable it instead?

@henderkes
Copy link
Contributor Author

Maybe could we also enable mimalloc in our Docker images too, or explain how to use it with Docker in the docs?

Since the Docker images link against musl dynamically, the way to use mimalloc there would be the same as with glibc (installing mimalloc and setting LD_PRELOAD).

I shall document that after I get at least two prototypes for the cli rework in php-src done.

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.

Static binary - merge mimalloc binary into musl one?

2 participants