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

Add release profile optimiztion #27

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

lidarbtc
Copy link
Contributor

codegen-units = 1 increase compile times but it improve both runtime speed and reduce binary size.
strip = true strip debug info and symbols from the compiled binary. so it can reduce binary size.

I made simple table for pumpkin binary size and compile times comparison.

Configuration Option Description Increases Compile Time Reduces Binary Size Improves Runtime Performance Compile Result (Time; Size)
codegen-units = 1 Improves runtime speed and reduces binary size Yes Yes Yes 1m 19s; 4.0M
strip = true Strips debug info and symbols from the compiled binary No Yes No 1m 10s; 3.7M
codegen-units = 1 + strip = true Applies both to improve runtime speed and reduce binary size Yes Yes Yes 1m 19s; 3.5M
None Uses default settings No No No 1m 14s; 4.2M

@Snowiiii
Copy link
Owner

Hey, Thanks for the PR 😁. This is actually exatcly what i wanted to do myself. Results looking very nice. But im wondering if we may also should enable panic = abort and how it does affect binary size

@lidarbtc
Copy link
Contributor Author

Hey, Thanks for the PR 😁. This is actually exatcly what i wanted to do myself. Results looking very nice. But im wondering if we may also should enable panic = abort and how it does affect binary size

panic = abort also reduce binary size. however, if a panic occurs, it will not be able to recover from the error and all thread will crash. This makes error handling difficult. Not recommended.

@Snowiiii
Copy link
Owner

mhh you right, It is not optimal. Overall Everything looks good. Thanks👍

@Snowiiii Snowiiii merged commit 44212b4 into Snowiiii:master Aug 11, 2024
1 check passed
@lidarbtc lidarbtc deleted the release-profile-opt branch August 11, 2024 07:26
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.

2 participants