Skip to content

Avoid opening a new thread for TruffleCompiler #9045

Answered by chumer
nsoubelet asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

Yes, you can perform the compilation on the main thread by setting the engine.BackgroundCompilation option to false. However, we do not recommend doing this, as it can cause latency spikes in the evaluation of code (up to seconds). I have yet to encounter a use case where I would recommend turning off background compilation.

The compilation is expected to be performed only once per polyglot Source, so if you are running in a long-running server process, I would recommend keeping background compilation on, but at the same time making sure code caching across contexts is enabled, so scripts only need to be compiled once per server process. See here for instructions:
https://www.graalvm.…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nsoubelet
Comment options

Answer selected by alina-yur
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants