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

Schedule initialization of JS context in a separate thread #5680

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Feb 17, 2023

Pull Request Description

Implements the #5643 idea. As soon as MainModule creates Context for GraalVM execution, it schedules a background task to initialize JavaScript. The initialization finishes sooner than Enso compiler is ready to work, saving time when it is actually needed.

Important Notes

Only modifies boot sequence of MainModule (used in the IDE) and VerifyJavaScriptIsAvailableTest (to verify the "context passing logic" works OK between threads). Regular CLI execution remains unchanged for now assuming batch execution may not need JavaScript in all the cases and if it does the initialization speed isn't that critical.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.

@JaroslavTulach
Copy link
Member Author

Analysis of the new startup is available as comment in the original bug report.

Copy link
Collaborator

@hubertp hubertp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

Copy link
Member Author

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review.

@JaroslavTulach JaroslavTulach added the CI: Ready to merge This PR is eligible for automatic merge label Feb 17, 2023
@mergify mergify bot merged commit cb3bcbb into develop Feb 17, 2023
@mergify mergify bot deleted the wip/jtulach/BackgroundInitJsContext branch February 17, 2023 15:54
@enso-bot
Copy link

enso-bot bot commented Feb 20, 2023

Jaroslav Tulach reports a new STANDUP for the last Friday (2023-02-17):

Progress: - Init JS context in a separate thread done: #5680

Next Day: Finish HostException handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schedule initialization of JS context in a separate thread after main compiler's initialization is done
3 participants