3 ms·
> So if you need to check another position around the current one Key word "around". If a coordinate object is immutable, then doing operations on a neighbori
by thedufer 12y ago
> So if you need to check another position around the current one
Key word "around". If a coordinate object is immutable, then doing operations on a neighboring one requires another allocation for the new coordinate object.
Unless you're suggesting having a coordinate version of every function that operates on a BlockPos, in which case there's no point at all in BlockPos existing.
- Groxx 12y agoThat's basically what I'm suggesting. Use it only on hot paths you've profiled, maintain purity elsewhere. Java pretty much requires you to make concessions if you're trying to get maximum performance. Similarly: it has a garbage collector, but there are plenty of places where an object pool will out-perform it. Deliberately breaking / re-implementing part of the language for performance reasons.
- deleted 12y ago[deleted]