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

[Improvement]: Implement dead code elimination #43111

Open
heshanpadmasiri opened this issue Jul 17, 2024 · 0 comments · May be fixed by #43560
Open

[Improvement]: Implement dead code elimination #43111

heshanpadmasiri opened this issue Jul 17, 2024 · 0 comments · May be fixed by #43560

Comments

@heshanpadmasiri
Copy link
Member

heshanpadmasiri commented Jul 17, 2024

Description

From #43013

The Ballerina compiler currently includes all imported modules in their entirety within the final executable JAR. However, these modules may contain unused constructs that bloat the final size. This project proposes an optimization to remove these unused parts, resulting in several benefits:

  • Smaller final executable JAR: Reduced file size improves storage efficiency and distribution.
  • Faster GraalVM native image build: Less code translates to quicker build times.
  • Smaller GraalVM native image executable: A more compact native image improves deployment efficiency.
  • Potential startup time improvements: A smaller executable might lead to faster program startup.

This project is driven by the substantial benefits it brings to GraalVM native image builds. We've achieved significant improvements in both build time (up to 15.95% faster) and executable size (up to 20.9% smaller). See the attached performance comparison in the Samples section for detailed results.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@heshanpadmasiri heshanpadmasiri self-assigned this Jul 17, 2024
@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Jul 17, 2024
@heshanpadmasiri heshanpadmasiri added Area/Compiler and removed needTriage The issue has to be inspected and labeled manually labels Jul 17, 2024
@heshanpadmasiri heshanpadmasiri moved this from In Progress to PR Sent in Ballerina Team Main Board Jul 17, 2024
@heshanpadmasiri heshanpadmasiri moved this from PR Sent to In Progress in Ballerina Team Main Board Jul 25, 2024
@heshanpadmasiri heshanpadmasiri moved this from In Progress to PR Sent in Ballerina Team Main Board Jul 26, 2024
@MaryamZi MaryamZi linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment