Live data from Hacker News

Native Minecraft servers with GraalVM Native Image

github.com

11–20 of 92 posts

Re: Native Minecraft servers with GraalVM Native Image

#11
post #6

"As such, it is supposed to require fewer CPU and memory resources, provide better startup times, and be easier and cheaper to deploy." 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.

>Startup are a none issue 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.

A Minecraft server is not a short term job.

Re: Native Minecraft servers with GraalVM Native Image

#12
post #2

Can the same trick be used with the java client? My son runs minetest on the raspberry pi 400 as minecraft is to slow. I'll do everything for a bit more fps.

Minecraft Bedrock edition runs better. It has feature parity but is not compatible with java server, and requires a new purchase IIRC.

> Minecraft Bedrock edition runs better. It has feature parity but is not compatible with java server, and requires a new purchase IIRC.

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.

Re: Native Minecraft servers with GraalVM Native Image

#13
post #6

"As such, it is supposed to require fewer CPU and memory resources, provide better startup times, and be easier and cheaper to deploy." 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.

Disclaimer: I work on the GraalVM team.

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...

Re: Native Minecraft servers with GraalVM Native Image

#14
post #6

"As such, it is supposed to require fewer CPU and memory resources, provide better startup times, and be easier and cheaper to deploy." 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.

>Startup are a none issue 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.

This is a Minecraft server, so it's going to be running 24/7.

Re: Native Minecraft servers with GraalVM Native Image

#15
Is Graal VM a silver bullet? Ignoring startup times, will Graal VM out perform classic JVM (IBM/Oracle etc'). I guess the optimization of the classic JVM are hard to beat. Also, cross compile is not working with Graal VM (which makes it harder to deploy than a good old Jar file).

Re: Native Minecraft servers with GraalVM Native Image

#16
post #2

Can the same trick be used with the java client? My son runs minetest on the raspberry pi 400 as minecraft is to slow. I'll do everything for a bit more fps.

I don't think the student looked into that at all, but I guess it depends on what the Java client uses for drawing. GraalVM Native Image currently doesn't support AWT on Linux/JDK17+, but we are working on fixing that soon.

> it depends on what the Java client uses for drawing

AFAIK, the Java client uses LWJGL, which is a native library.

Re: Native Minecraft servers with GraalVM Native Image

#17
post #16

Earlier quoted context omitted.

I don't think the student looked into that at all, but I guess it depends on what the Java client uses for drawing. GraalVM Native Image currently doesn't support AWT on Linux/JDK17+, but we are working on fixing that soon.

> it depends on what the Java client uses for drawing AFAIK, the Java client uses LWJGL, which is a native library.

Thanks for the info! Seems like it's worth trying to compile the Java client with GraalVM Native Image then, given that this exists: https://github.com/chirontt/lwjgl3-helloworld-native

Re: Native Minecraft servers with GraalVM Native Image

#19
post #6

"As such, it is supposed to require fewer CPU and memory resources, provide better startup times, and be easier and cheaper to deploy." 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.

>Startup are a none issue 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.

I encourage my competitors to keep thinking this.

Re: Native Minecraft servers with GraalVM Native Image

#20

Is Graal VM a silver bullet? Ignoring startup times, will Graal VM out perform classic JVM (IBM/Oracle etc'). I guess the optimization of the classic JVM are hard to beat. Also, cross compile is not working with Graal VM (which makes it harder to deploy than a good old Jar file).

On some micros Graal beats C2, on some others it doesn't. It's not a silver bullet.

GraalVM is regular OpenJDK with the compiler switched out, AFAIK.

Post reply on HN