Did you AOT compile your program? If not I think you will see a big improvement in speed if you do. Also I noticed that in your main loop you are using a button listener. This will poll for button changes every 50 ms which will load the CPU unnecessary. In the next release it will be possible to set this interval when creating the button listener so you might consider adding this.