3 ms·
Notchian code ran way better than modern MC - even though it used completely obsolete OpenGL 1.1 fixed-function calls. They've upgraded to OpenGL 3 and shaders
by Pannoniae 3y ago
Notchian code ran way better than modern MC - even though it used completely obsolete OpenGL 1.1 fixed-function calls.
They've upgraded to OpenGL 3 and shaders now; but the game's memory and CPU usage is through the roof with inconsistent performance and huge lagspikes.
Most of this is caused by utterly spurious and unneeded allocations; stream code on hot paths and complete overengineering and abstractions totally unfit for purpose. By that I mean heavy usage of inheritance and indirection in rendering code, and horrible memory wasting with vertex data. (Most things are full floats even if they could be packed and in some cases, even duplication of the same data due to bad data design)
- kaba0 3y agoDo you have any source for that? It seems questionable at best. Also, depending on where it is used, Java deals very well with indirect calls, it doesn’t have the same cost as, say, a C++ virtual call.
- Pannoniae 3y agoSource for which section? I am basing this on mostly my experience and codedigging - I don't think there are many written sources about observing this other than anecdotes on forums or reddit or whatever. With that being said, I'm happy to investigate in detail if you can tell which parts you are interested in. You are right, the JVM has many optimisations built in to de-virtualise calls and avoid allocations and the such, but if you abuse it, the JIT will give up. I don't think any JIT will de-virtualise or perform escape analysis on 5-6 layers of indirection with branching.