So we don't even know if it actually makes things faster? Startup are a none issue, CPU / memory is but you need proof for that.
Graal does not support ZGC or Shenandoah so it's hard to say if the G1 version from Graal is up to speed.
The students "measured noticeable reductions in terms of memory footprint of up to 43%" [1] in some preliminary experiments. More from the accompanying blog post:
"We also hope that the Minecraft community builds on our work and helps benchmark different configurations for native Minecraft servers in more detail and in larger settings."
Please feel free to share any numbers on CPU/memory usage with us!
[1] https://medium.com/graalvm/native-minecraft-servers-with-gra...
If I understand the article correctly, you're preempting all possibly unoptimized/expensive code paths (reflection) by attempting to literally execute all of them? While it's a cool experiment, isn't it a bit error-prone (besides being a lot of effort of course, but playing Minecraft on the side does sound pretty fun!)?
lets you spawn new game instances on the fly, reduce time spent loading the chunks and game data
you save a lot of money when you scale, and you improve latency, people don't complain with huge loading time and stutters for fresh servers
ask anybody working on the industry
fun fact, that's the first thing Riot did when they acquired Hytale
They rewrote their C# client to C++ for portability
And they rewrote their Java server to C++ for performance (and cost saving)
Tech Change: https://hytale.com/news/2022/7/summer-2022-development-updat...
Yes it is. Developing any short term job -- that runs multiple seconds and goes away -- like lambda or k8s jobs with Java is meaningless for exactly this reason. The startup time is longer than the run time.
https://github.com/cuberite/cuberite
"Cuberite is a Minecraft-compatible multiplayer game server that is written in C++ and designed to be efficient with memory and CPU"
Cuberite has been demoed running on old ARM Android phones and hosting multiple players off it at once. Its performance absolutely annihilates the Java based 'vanilla' server
Native compilation usually makes things a little slower, not faster. Using the closed-source Enterprise version, and using PGO gets it back to around the same speed as the VM version I believe currently.
That's no longer the case. If you have one, you can "purchase" the other for free. See https://www.minecraft.net/en-us/article/java---bedrock-editi... and https://help.minecraft.net/hc/en-us/articles/6657208607501 for details.
Also, there are mods for the Java server which allow both Java and Bedrock clients to connect to the same server and play together. I don't know the details, but I have played in a server which used these mods.
AFAIK, the Java client uses LWJGL, which is a native library.
I've got a number is spring web applications from which I create an uberjar (jar file with all dependencies) and run them in a Centos server using something like java -jar server.jar (it's a little more complex than this but you get the idea).
Would I be able to use graalvm to create native binaries from these jars? Is there some kind of tutorial describing the procedure?
Is this possible without a license/paying big money?
Finally, is this worth it? Will the apps become any faster?
There is a Graal Community Edition, which is free. Search for graal and spring pet clinic demo, you will likely find an article reducing startup time 100x (starting pet clinic in 15ms), and reducing memory 2-3x.
I don't know about 'faster', but in my experience most spring applications are RAM bound, not CPU bound. So the native binaries can result in scaling back to smaller and cheaper cloud instances, or smaller VMs. Imagine halving your monthly cloud instance bill, if you are looking for 'worth it'.
If you want to play with a framework where the native part works pretty okay, and still be able to use your dependent injection and dependencies, have a look at Quarkus. They even have some spring 'polyfills'.
Frameworks like Quarkus and Micronaut have been written with native in mind and I think Spring is also working on it (Spring Native).
There is spring native that will solve it for the most part, but I’m not sure how hard it is to change an existing spring web app to that.
GraalVM has a community edition, which is free, I’m not sure about the license.
And it is likely not worth it, performance will likely be worth, but memory usage and startup speed will decrease. It can be worth it for command line apps or some tiny microservice that is mostly idle.
I'll also take a peek on spring native it seems to be available in beta: https://github.com/spring-projects-experimental/spring-nativ...
That’s not true. For the majority of applications the JIT compiler will be much faster (either Graal’s JIT compiler or Hotspot). Startup time, and memory reduction is true though for AOT.
Caveat: I also haven't been using Native Images yet, though. So I can't comment on if it'll be dramatically different for that build target.
There are a lot of non-biased benchmarks you can find online, most of them showing that Graal (both CE/EE, though particularly EE) are more performant than OpenJDK.
You then also have the option to compile to native, or to embed/run code in other languages baked in.
It's a no-lose scenario IMO.
There are multiple benchmarks that show marginal gains using GraalVM CE for big data workloads; it might make sense if you're still stuck on Java 8 or 11. The enterprise edition shows more significant gains.
The community version has only serial or nothing, which are ok for small heaps or short lived processes.
GraalVM is regular OpenJDK with the compiler switched out, AFAIK.
How would this be possible for a static native executable?