
Making Minecraft 100x faster (by rewriting it in Rust) | Theo - t3․gg YouTube Video Summary
Theo reviews 'Pumpkin', a Minecraft server built entirely in Rust. The numbers are impressive as it’s a 20x reduction in CPU usage and a 100x reduction in RAM. He gives a shoutout to the sponsor of the video, Blacksmith, and then returns to Minecraft. He then explains how to utilize this project with specific reference points. It has been noted that lighting currently doesn't work but it’s definitely something to keep an eye on.
Detailed Summary:
Minecraft in Rust?
Theo is excited to talk about Minecraft today and not just about his history of it. In fact, there is a new Minecraft server client called ‘Pumpkin’ written in Rust which is set to improve performance. In hosting Minecraft servers this performance is definitely needed.
Microsoft and C++
Theo didn’t want to talk about the Bedrock re-write Microsoft did in C++ because it is a mess. It has not only not improved performance, it is riddled with bugs and just doesn’t feel like the same game as Java. Many open source clients are available, written in Java but provide plugins and APIs with less performance and hosting options than desired.
Pumpkin’s Performance
According to tweets, Pumpkin has been seeing around 2 gigs of RAM at 24% CPU usage reduced to 27mb of RAM at 1.5% CPU usage. The reason for the reduced usage is caching the already loaded chunks, resulting in less overall RAM and CPU usage.
Blacksmith
Today’s sponsor is Blacksmith, which helps rust developers with slow compilers get faster builds on GitHub actions while also being cheaper. By swapping out the ‘runs-on’ in the GitHub actions config file, you get a ton of free minutes each month. With just swapping the command you can be up to half the cost while being twice as fast. Visit soydev.link/blacksmith for more details.
Gotchas and Catches
Since we know it’s written in Rust, the developer community has been trying to get a Minecraft server running for a while. It has only been 37 days since the release of Minecraft server software written in Rust called FerrumC. With a large warning up top, the software is currently undergoing re-writes but has been receiving commits as recently as one hour ago. You can see planned but not yet implemented items, one of which is world saves (big issue).
Time to Tinker
Theo then clones the project with git clone https://github.com/Snowiii/Pumpkin.git
followed by changing the directory to said cloned path and running cargo run --release
, spinning up the project with surprising ease. He also notes that he needs to upgrade the version of Rust before being able to play, but it only took one small Rust upgrade. To be fair, Minecraft itself also required updating and did fail to run the first time but did end up working.
The End Result
With around 0.01% CPU the server is clearly not struggling. With the world built, the lighting system is a bit broken so the view is a little dark. Pumpkin utilizes around 200mb of RAM, which is very small compared to the amount of RAM Minecraft servers have taken up in the past.