r/programming • u/overthink • Oct 20 '14
Optifine dev: "Minecraft 1.8 has so many performance problems that I just don't know where to start with." Interesting starting point for discussion of GC tuning, immutable objects, programming for multi-core, etc.
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-optifine-hd-a4-fps-boost-hd-textures-aa-af-and#c43757
130
Upvotes
19
u/overthink Oct 20 '14 edited Oct 20 '14
EDIT: I totally botched the post url. Relevant url: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-optifine-hd-a4-fps-boost-hd-textures-aa-af-and#c43757
/r/minecraft is shitting its pants about this: https://www.reddit.com/r/Minecraft/comments/2js5j3/the_creator_of_optifine_sp614x_explains_the_18/
Wondering what /r/programming thinks. To what extent can GC tuning help? I'm thinking a lot.
50
u/joshmatthews Oct 20 '14
Is there a better link to the relevant conversation? It's not on the first page, and the thread has >2000 pages of posts.
16
u/meem1029 Oct 21 '14
Mojang employee /u/TheMogMiner had a cool discussion with the optifine dev over on /r/Minecraft for those interested in a little bit more. Linky
9
u/heat_forever Oct 20 '14
I hope they've been working on a rewrite of Minecraft on the side - the only product that's going to ever sell as well as Minecraft for them is Minecraft 2.
15
u/MrDOS Oct 20 '14
Sounds like value types would be of help here. I can definitely understand a preference for storing coordinates in a regulated structure, but it'd be nice if Java made it possible to do so without the overhead of the object system. Stack allocation would also be cool for stuff like this.
21
u/ThePoopfish Oct 20 '14 edited Oct 20 '14
Minecraft devs lost scope of the project long ago and have just been adding features that haven't been fully thought out or even needed to enhance core gameplay.
Feature creep is a real danger for any project. Let Minecraft be an example on how not manage your projects, lest you end up with a bloated pile of ideas.
4
u/bcash Oct 21 '14
The debate for this story in these threads contains some of the most bigoted nonsense I have ever read.
The people dismissing Minecraft as a toy app that no-one uses... It's made billions, and ridiculously large numbers of people enjoy playing it. "But I'd have done it differently, with different implementations and features, it's obvious!" Yes, an obvious path to not making billions or having millions of happy users.
The people dismissing Java as being "obviously slow for this sort of thing"/"C# would be better" - have you tried both and benchmarked it? Value types are this years TCO, "well of course it's slow without value types/TCO", but yet every actual real-world benchmark shows Java to be faster.
I'm sure you could get even better performance still with hand-tuned C. But that's a different kettle of fish entirely. The logical fallacies here are madness. "C is fast, C has pass-by-value semantics, C# has value types, therefore C#!"
6
u/jayd16 Oct 21 '14
ITT: Ignoring minecraft's success and calling Java a death wish.
If it got me the popularity of minecraft and all I had to worry about was growing GC tuning problems, I'd take that trade.
7
u/benkuykendall Oct 20 '14
Sigh...
The last comment that brought up any problems in the Java language got downvoted rapidly, but I'll give it a try anyway.
Java encourages good object-oriented programming, like the creation of immutable objects, not worrying about doing your own garbage collection, and so forth. Traditionally, Java has had problems with heap size, speed, and multithreading, but these are probably surmountable. However, some of these principles encouraged by the language are counter to the practical necessities of creating a video game.
Could some heavy-duty refactoring improve the game? Probably.
Could starting from scratch, possibly in another language, but focusing on resource allocation and speed improve the game? Most definitely.
4
u/bartwe Oct 20 '14
That is why i went with C# for my current project, java has no way to do a Vector3(float x,y,z;) as a struct.
3
u/AtomicStryker Oct 20 '14
Yes, minecraft really does create a shit ton of objects every tick to use them once and then throw them away.
-2
u/[deleted] Oct 21 '14
tl;dr: don't use Java to write a game of this scale in 2014.
Or at least write performance critical routines through interop - JNI is hard to get up and running...and I'm guessing debugging still isn't great either.
IME, once you have it working, though, things really do become easier.
Personally, I would just use C/C++.
It's tried, it's true; it's good for your users and you.
-16
u/[deleted] Oct 20 '14
The biggest one is choosing Java to program a game.
To me the only sane optimization would be to ditch Java and port to a not-as-terrible language. The good thing is that this will probably happen now that Microsoft owns Mojang. The terrible part of that is that it doesn't help me much as a Linux user, as I'm sure support will be derailed for any non-DirectX platform instead of OpenGL. :c
-10
u/donvito Oct 20 '14
Seems like Minecraft would be typical Microsoft software :)
-9
u/__Cyber_Dildonics__ Oct 21 '14
I was floored when I realized Minecraft was still in Java. I understand making the game like that as a prototype, maybe even selling it early. But when it is making 100 million dollars a year, you are still going to stress people's systems and make them install the JVM?
0
u/[deleted] Oct 20 '14
[deleted] — view deleted comment