3 ms·
I remember reading a blog post where somebody talked about how they severely decreased Minecraft's performance after refactoring and replacing function calls wi
by looki 11y ago
I remember reading a blog post where somebody talked about how they severely decreased Minecraft's performance after refactoring and replacing function calls with separate X, Y and Z parameters to using a single Position object, which would of course in many instances have to be allocated on the fly. I can't seem to find it anymore, though.
- wtallis 11y agoYes, something that should have at a minimum caused no harm to performance (and possibly helped, such as by allowing for SIMD) and been a win for code readability instead introduced an extra layer of pointer chasing and heap allocation, because Java doesn't have structs. See https://news.ycombinator.com/item?id=8485180 https://news.ycombinator.com/item?id=8485180
- mike_hearn 11y agoIndeed. They are adding value types though. It'll take years but once done, this kind of problem shouldn't crop up again. They've also been doing work on better escape analysis. The JVM can do a lot of optimisations C++ apps don't benefit from, but I think the loss from not having value types more than drowns them out.
- looki 11y agoThat's the one, thank you.