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

[Bug]: Slowness in module initialisation phase when running Ballerina programs #43727

Open
NipunaRanasinghe opened this issue Jan 2, 2025 · 0 comments
Assignees
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@NipunaRanasinghe
Copy link
Contributor

Description

Even though a very basic Ballerina programs (without any imports) have a good enough startup times, when the programs get larger with multiple imports, the startup time gets significantly high (4-5 seconds in average), mainly due a slowness observed in module initialization phase in Ballerina runtime.

This specifically affects the user experience in fast-run mode, where the compilation time is negligible (as we use compilation cache from the LS). Therefore the module initialization delay becomes more prominent than the compilation time, making it the main bottleneck.

Steps to Reproduce

Below is a simple Ballerina code snippet to reproduce the issue.

import ballerina/io;
import ballerina/http as _;
import ballerina/graphql as _;

public function main() {
    io:println("Hello World");
}

Execute the bal run command and observe the delay during the execution of the main function. The slowness is noticeable in the Running executables... phase after the compilation is complete.

Affected Version(s)

2201.11.0 and below

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Jan 2, 2025
@warunalakshitha warunalakshitha moved this from In Progress to Planned for Sprint in Ballerina Team Main Board Jan 7, 2025
@warunalakshitha warunalakshitha moved this from Planned for Sprint to In Progress in Ballerina Team Main Board Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
Status: In Progress
Development

No branches or pull requests

4 participants