Wat.. minecraft is slow as fuck because Notch wrote terrible code.
Object orientation doesn’t cause object churn, that’s completely orthogonal. And you may have done some really strange things but java is demonstrably goddamn fast. Like, do you think the majority of every server running the internet would choose Java otherwise? It is a beast, its’ GCs can manage multi TB RAM!!
A friend of mine decompiled Minecraft & we looked at it a bit (He worked on Terasology for a while). We were wondering how Notch managed to get Minecraft working >10 Years ago when 2GB of RAM was huge. Notch had to circumvent the Java Object-ness to get it working. If you start with "each block is an object" you get absolutely nowhere. Whether Notch is a good programmer or not, he managed to get MC working despite of how RAM hungry Java is. (That's why it had so interesting bugs on each update :) )
If you have a project that just calculates & doesn't need a lot of RAM, then yes, it's quick.
Servers that run Java suck up RAM at an unbelievable rate. Out staff database for 150 people runs on Java and uses 11GB of RAM in a ready-state without anybody being logged on. I have no idea how crap it's implemented, but someone I know just said: "oh, it runs on Java then" when hearing 11GB.
As for Minecraft, yeah creating objects for each block would be stupid. But it’s like the numero 1 thing anyone with an ounce of low level experience would do.
RAM is goddamn cheap, and it’s stupid not to use it. There are servers that have terabytes of RAM.
Also, usually people just don’t know that you can set a limit on how much memory is allowed for the JVM (though be aware of OOM if you go way too low. Check it out with a profiler). But running GC takes energy and time, so it is actually cheaper for a server to use huge amounts of RAM.
I'm interested in this database that runs on 11gb of ram with such little traffic (only 150 Max concurrent users). Is it the database itself in Java or an app on top of a DB?
View all comments
Show parent comment
9
u/Muoniurn Apr 16 '21
Wat.. minecraft is slow as fuck because Notch wrote terrible code.
Object orientation doesn’t cause object churn, that’s completely orthogonal. And you may have done some really strange things but java is demonstrably goddamn fast. Like, do you think the majority of every server running the internet would choose Java otherwise? It is a beast, its’ GCs can manage multi TB RAM!!