I need to compile and execute user's code several times (business logic). Just for Hello world
example compilation and execution of that code takes 2-3 seconds. Is there a way to make compiling and running java code be faster? As you can see, it is just a Hello world
.
As far as code to be compiled, he will be very short (maximum number of lines should not be over 200, and within single file (with 1-2 private classes). I need to return output and the error to the user if it happens, and that's all. I use Java on Ubuntu 14.04 within Docker containers. Also, all of this is for testing programming skills. GUI is not an option, command line applications.
I'm interested in reducing time needed JVM to compile and execute that code. How I can achieve this?