Skip to content

Reduce memory footprint of the Swift compiler #401

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

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Dec 10, 2015

Use malloc/free for allocating/freeing SIL instructions instead of using the BumpPtrAllocator. This allows for memory reuse and significantly reduces the memory footprint of the compiler.

For example, a peak memory usage during a compilation of the standard library and StdlibUnitTest is reduced by 25%-30%. The performance of the compiler seems to be not affected by this change, i.e. no slowdown is measured.

This is re-submission of the updated #14, because GitHub had issues updating my original PR with the latest changes.

Use malloc/free for allocating/freeing SIL instructions instead of using the BumpPtrAllocator. This allows for memory reuse and significantly reduces the memory footprint of the compiler.

For example, a peak memory usage during a compilation of the standard library and StdlibUnitTest is reduced by 25%-30%. The performance of the compiler seems to be not affected by this change, i.e. no slowdown is measured.

The use-after-free issues reported by build bots are fixed now.

rdar://23303031
@swiftix swiftix changed the title Re-apply "Reduce memory footprint of the Swift compiler" Reduce memory footprint of the Swift compiler Dec 10, 2015
@swiftix
Copy link
Contributor Author

swiftix commented Dec 10, 2015

Hopefully, we managed to fix all the instruction deletion related bugs in the meantime.

swiftix added a commit that referenced this pull request Dec 10, 2015
Reduce memory footprint of the Swift compiler
@swiftix swiftix merged commit 3794ba7 into swiftlang:master Dec 10, 2015
slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
kateinoigakukun pushed a commit to kateinoigakukun/swift that referenced this pull request Mar 17, 2020
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
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.

1 participant