Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the mimalloc option to speed up the compiler on Windows #76563

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

hjyamauchi
Copy link
Contributor

This is disabled by default.

@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

utils/build.ps1 Outdated Show resolved Hide resolved
utils/build.ps1 Show resolved Hide resolved
@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

@hjyamauchi
Copy link
Contributor Author

@swift-ci please test Linux Platform

$Args += "-l"
$Args += $ExePath
Invoke-Program "$SourceCache\mimalloc\bin\minject" @Args
dir "$ExePath"
Copy link
Member

Choose a reason for hiding this comment

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

Debugging left overs?

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 mean to keep it so that we can verify that the import table is updated in the toolchain build log

@hjyamauchi hjyamauchi merged commit b2cb375 into swiftlang:main Sep 23, 2024
5 checks passed
@gregcotten
Copy link

@hjyamauchi have you observed significant compiler performance gains using mimalloc? Would you recommend the MS Swift Toolchain use it by default in an upcoming release?

@hjyamauchi
Copy link
Contributor Author

@gregcotten In our internal app build, the build was about ~4% faster (which we think is meaningful in our long, long build times) and it seemed stable/robust. We have a plan to have it enabled by default in our future internal toolchain update but that's currently blocked by various other factors. I encourage testing it out independently, if you can :)

@hjyamauchi hjyamauchi deleted the mimalloc branch November 1, 2024 19:16
@gregcotten
Copy link

@gregcotten In our internal app build, the build was about ~4% faster (which we think is meaningful in our long, long build times) and it seemed stable/robust. We have a plan to have it enabled by default in our future internal toolchain update but that's currently blocked by various other factors. I encourage testing it out independently, if you can :)

Thanks for the info! After adopting macros into a Windows Swift production app compile times have grown exponentially and I'm looking for any savings possible! Not sure if it's worth the hassle of maintaining my own toolchain though...

@hjyamauchi
Copy link
Contributor Author

Sure! We, BCNY, have our own toolchain builds where it's enabled by default, if you're interested (note they're separate from the official swift.org builds): https://github.com/thebrowsercompany/swift-build

We may be able to enable it by default upstream but I cannot tell whether or when it would happen :)

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.

3 participants