-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Description
In my environment (a non-Java developer on Windows) I noticed that Oxalis-NG's standalone JAR takes a considerable amount of time to start under a new JVM process (via java.exe). To my observation, the latency is related to JVM cold startup, which amounts to upwards of 5 seconds for me!
After doing some research on how to speed this up, I came across the NailGun project. It's an old project, granted, but I saw no other alternative apart from learning Java server development myself and hosting the Oxalis outbound component in my own Java server. It took some finagling, but I finally managed to successfully run a local test with Oxalis-NG's standalone JAR hosted in a NailGun and observe the gains: <1s compared to 5-8s, which is huge!
The reason I'm writing here is one small bit of finagling I had to do to the Oxalis-NG standalone app's source, for this to work.
Specifically, I had to remove a line of code in Main.java that reads:
System.exit(failed == 0 ? 0 : 1);
because it turned out that the System.exit() call was also exiting the NailGun host, which defeated the entire purpose of using NailGun!
I'm aware that having a meaningful exit code from a console process is a nice thing. However... It's also such a small thing to lose, especially if you don't really need it, because there is ample information on both standard and error output to be able to ascertain if the component did its job successfully or not!
My proposal is to simply get rid of this line of code in the official branch. Or, maybe, do it conditionally, based on detecting if the component is truly being run as a standalone process, or hosted in a server, such as NailGun?
Would this be possible?
FWIW, I've currently resigned to checking out each new tag, removing the line manually, then rebuilding the checked out source locally using Maven, and deploying my local build to where I need it. It works! But it is tedious... So I'm asking for a bit of help to avoid this, if possible!
Thank you very much for considering! I find Oxalis-NG to otherwise be an amazing piece of machinery! ;)