This task is automatically imported from the old Task Issue Board and it was originally created by jaroslavtulach.
Original issue is here.
Why
As Enso UserI want the engine start and work fastSo that opening a project doesn't take five seconds or more
Acceptance Criteria
Scenario:
Given newly created project
When it is opened
Then the engine shall work immediatelly without typical _java-like_ warm up.
Notes:
GraalVM offers AOT - native image - compilation which is the recommended way for Truffle languages to offer almost instant startup and better user experience.
Tasks:
[X] Investigate what it would take to compile engine with native image
[X] Modify build.sbt to invoke native-image compilation for the engine
[X] Investigate why engine+runner combo crashes the compilation
[X] How to load libraries in NI mode? Espresso - yes, it can work: #183260380
[X] Make sbt engine-runner/buildNativeImage goal part of the CI to verify proper @TruffleBoundary annotations: #183136313
@hubertplociniczak , if you can take a look at `build.sbt` and modify it to create a new task to invoke native image with proper engine (probably `runtime.jar` and `runner.jar`) class path, that'd be great. Compilation may fail, but it'll be easier for me to take over when we have the `sbt` task. (jaroslavtulach - Aug 5, 2022)
I tried to use Hubert's sbt changes, but the NI compilation was crashing. As such I had to create something simpler. Branch SimpleLauncher shows the instant startup benefits of using Native Image for compilation & execution. Follow the readme and you will see that executing simple helloworld takes 40ms:
time ./target/simplelauncher fac.enso
3628800
real 0m0,038s
user 0m0,021s
sys 0m0,017s
which is hundred times faster than traditional 4s needed to boot the Enso engine in JVM mode. (jaroslavtulach - Aug 19, 2022)
With the help and guidance of Chris Seaton I managed to compile the launcher with sbt engine-runner/buildNativeImage when I gave the process enough memory (22GB was enough). E.g. the next milestone has been reached. Next goal: make the sbt engine-runner/buildNativeImage goal part of the CI run to verify all the necessary @TruffleBoundary annotations are in place. (jaroslavtulach - Aug 22, 2022)
This task is automatically imported from the old Task Issue Board and it was originally created by jaroslavtulach. Original issue is here.
Why
As Enso User I want the engine start and work fast So that opening a project doesn't take five seconds or more
Acceptance Criteria
Notes:
GraalVM offers AOT - native image - compilation which is the recommended way for Truffle languages to offer almost instant startup and better user experience.
Tasks:
native-image
compilation for the enginesbt engine-runner/buildNativeImage
goal part of the CI to verify proper@TruffleBoundary
annotations: #183136313Blockers:
#183260380 resolved #183136313 resolved #183374932 resolved #183802194 resolved #184256209 blocked
Comments:
I tried to use Hubert's
sbt
changes, but the NI compilation was crashing. As such I had to create something simpler. Branch SimpleLauncher shows the instant startup benefits of using Native Image for compilation & execution. Follow the readme and you will see that executing simple helloworld takes40ms
:which is hundred times faster than traditional
4s
needed to boot the Enso engine in JVM mode. (jaroslavtulach - Aug 19, 2022)With the help and guidance of Chris Seaton I managed to compile the launcher with
sbt engine-runner/buildNativeImage
when I gave the process enough memory (22GB was enough). E.g. the next milestone has been reached. Next goal: make thesbt engine-runner/buildNativeImage
goal part of the CI run to verify all the necessary@TruffleBoundary
annotations are in place. (jaroslavtulach - Aug 22, 2022)Status summary as of Aug 23, 2022: https://docs.google.com/document/d/1yZmj4y-mOswTUHFzYkV7FM6Vh9P9LLXj-plAW3bVzbI + will be discussed at 15:00 CET (jaroslavtulach - Aug 23, 2022)