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]: Improve bal run to use existing executable when no changes are detected #43752

Open
Dilhasha opened this issue Jan 16, 2025 · 0 comments
Labels

Comments

@Dilhasha
Copy link
Contributor

Description

Currently, the bal run command rebuilds the executable for every execution, even when there are no changes in the source code. This behavior applies to consecutive executions of both bal build and bal run. To avoid rebuilding, users are required to manually provide the executable JAR path, as follows.

bal run <executable-jar-path>  

Describe your problem(s)

This default behavior leads to unnecessary rebuilds, which impacts the execution time and performance, especially for use cases where,

  • The same program needs to be run multiple times with different arguments.
  • Iterative testing or debugging is being performed without any changes to the source code.

Describe your solution(s)

Update the default behavior of bal run to,

  1. Detect whether the source code has been modified since the last build.
  2. If no changes are detected, use the existing executable from the previous build instead of rebuilding.

Benefits

  • Improved Performance: Eliminates unnecessary rebuilds, reducing execution time.
  • Better User Experience: Simplifies execution flows by removing the need for users to provide the executable path manually for reuse
  • Efficiency: Enhances the usability of bal run for scenarios that involve multiple executions with unchanged code.

Related area

-> Other Area

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the needTriage The issue has to be inspected and labeled manually label Jan 16, 2025
@Dilhasha Dilhasha added Area/CLI Ballerina CLI related issues. Area/CLI-BuildTools and removed needTriage The issue has to be inspected and labeled manually labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants