Performance / JShell lightweight
Remi Forax
forax at univ-mlv.fr
Mon Aug 14 20:33:11 UTC 2017
Hi Robert,
It's due to the fact that by default JShell starts a new VM (the remote VM) that will execute the code,
if you just want to run the code, i think there is a way to run the script inside the same VM.
I will let the other Robert (Field) or anyone on this list explain how to do this,
i'm also interested by the answer (and the auto-exit at the end).
cheers,
Rémi
----- Mail original -----
> De: "Robert Scholte" <rfscholte at apache.org>
> À: kulla-dev at openjdk.java.net
> Envoyé: Lundi 14 Août 2017 22:24:25
> Objet: Performance / JShell lightweight
> Hi,
>
> I've started a library which has the ability to divide a set of jars and
> output directories over the classpath and modulepath. In order to get the
> modulename it calls the Java 9 code for retrieving that name, i.e. via
> ModuleFinder.
> In case the library runs on Java 9, it can call the ModuleFinder directly.
> But in case the library runs on Java 7 or Java 8, it requires a reference
> to the Java 9 home.
> With JShell it has become very easy to execute this code, otherwise I need
> to have an executable-jar at runtime, put is somewhere where I can call it.
>
> However, this call to JShell takes several seconds to resolve, which feels
> quite long. I'm looking for a way to reduce this time.
>
> I'm not interested in interaction with JShell, only interested in the
> output. (in the end it is almost as simple as a main method with
> System.out.println("Hello World"); )
>
> If the startup overhead is caused by building up the shell, can there be
> an option introduced to just execute code without interactive shell (and
> auto-exit at the end)?
>
> thanks,
> Robert
More information about the kulla-dev
mailing list