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

[ruby] Persist JRuby Script Container with Environment #5307

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DavidBakerEffendi
Copy link
Collaborator

Persisting the lazily created JRuby execution environment and loaded global variables with cleaning up only happening at shutdown.

This removes the overhead of JRuby instantiating a Ruby environment for each RubySrc2Cpg.

Persisting the lazily created JRuby execution environment and loaded global variables with cleaning up only happening at shutdown.

This removes the overhead of JRuby instantiating a Ruby environment for each RubySrc2Cpg.
@DavidBakerEffendi DavidBakerEffendi added the ruby Relates to rubysrc2cpg label Feb 13, 2025
@DavidBakerEffendi DavidBakerEffendi self-assigned this Feb 13, 2025
@DavidBakerEffendi DavidBakerEffendi added the performance Improves the performance of Joern label Feb 13, 2025
@DavidBakerEffendi DavidBakerEffendi marked this pull request as ready for review February 13, 2025 14:16
Comment on lines +48 to +53
val astGenResult = persistedRubyAstGenRunner match {
case Some(astGenRunner) =>
astGenRunner.execute(tmpDir, config)
case None =>
Using.resource(RubyAstGenRunner(config))(_.execute(tmpDir))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we create the runner here on demand for the non server scenario, when not always create it here on demand?

And i suggest we let X2CpgFrontend extend AutoClosable so that the close call can be handled be X2CpgFrontend and not in the individual frontend Main classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improves the performance of Joern ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants