5 ms·
It's really not great. Doable, but not great. That's why they moved to a classic C++ codebase instead on other platforms. On a side note, I worked on Jpcsp, a
by Orphis 6y ago
It's really not great. Doable, but not great. That's why they moved to a classic C++ codebase instead on other platforms.
On a side note, I worked on Jpcsp, a PSP emulator in Java. Great for research and doing refactoring in the code quickly, not great for performance, even with a JIT. We wrote later PPSSPP in C++, performance was there quite easily.
- jjice 6y agoGreat work on PPSSPP. I haven't used it in a few years, but even back then the performance was great!
- iamcreasy 6y ago> It's really not great. Could you provide some more information on what it was not great?
- mumblemumble 6y agoFor games, probably the worst thing about Java, especially if you're still on Java 8, is the garbage collector. Its pause times can be brutal. This won't be noticeable for games that aren't too hard on memory, or games where framerate doesn't really matter, but it was definitely noticeable (and annoying) in earlier versions of Minecraft. On Java 11 or later, I wouldn't expect it to be nearly such a big deal. At least not relative to some other issues. For example, it being a reflective language means that there's a fair amount of memory overhead that's really only there to support features that aren't so useful in games development. Also, there's a fair bit of overhead, in terms of both CPU and memory churn, to making calls into native libraries from Java. Nowadays, neither of those is a big deal for a large swathe of games, either, so I don't think one can really make a blanket statement that Java is not great for games development.
- mooman219 6y agoThe "Java is bad for games" mindset is in part just historical bias. Performance and GC are thrown around as shallow excuses for comparing idiomatic Java with game design C++. Actually applying methods to reduce memory pressure like using arenas, and accepting vectors to mutate instead of creating new ones solve most of the GC penalty you paid for not having to think about it while prototyping. Large servers in java minecraft patch the server to do just that, and they operate well. I think the biggest barrier for Java in Games is the stigma and lack of resources relative to C++.
- smabie 6y agoYeah, of course Java can make games. Hell, even some high frequency trading shops are using Java. But the amount of effort you have to put in to twist a language and ecosystem that is practically designed around frequent allocation is just not worth it. Like, if you're writing zero allocation Scala or Java you're going to be writing C/C++ in the first place. Might as well just use C/C++ instead of fighting the ecosystem tooth and nail.
- iamcreasy 6y ago> But the amount of effort you have to put in to twist a language and ecosystem that is practically designed around frequent allocation is just not worth it. Do you an example in mind? Unity3D uses C# which is a garbage collected language.
- smabie 6y agoAnd as anyone who as played Unity games would attest to, the performance is terrible. There's a reason why UE is much more popular than Unity for triple-A games. Take Escape From Tarkov, an FPS that tries to be a AAA game and uses Unity. The performance problems that game has is frankly staggering.