News for hackers. Stuff that matters.
Re:Java is very fast, if you don’t create many objects by golergka on Monday September 12, 2022 @08:58AM (#32809473)
> It's quite a paradox; Java is really fast if you keep allocations down, but Java "best practices" often involve tons of object creation.

That's because best practices are aimed at a task that is usually more important than performance: correctness and maintainability.

Re:Java is very fast, if you don’t create many objects by Diggsey on Monday September 12, 2022 @09:27AM (#32809868)
Yes, but the language would be better if correctness and maintainability were not so at odds with performance.
Re:Java is very fast, if you don’t create many objects by UncleMeat on Monday September 12, 2022 @09:33AM (#32809955)
It would be different. A large number of real world applications aren't especially performance sensitive and it makes sense to have tools that prioritize other things than performance. We also see how languages that do prioritize performance can suffer in other aspects (C++ is a clear example).

I think that this is fundamental in some way. Consider arithmetic. Fixed with integers suck from an ergonomics perspective. But variable-size integers are necessarily slower. Even designing something as basic as how arithmetic will work in your language forces you to consider performance against usability.

Re:Java is very fast, if you don’t create many objects by golergka on Monday September 12, 2022 @04:44PM (#32816663)
And databases would be better if consistency and availability were not so at odds with partition tolerance.
Re:Java is very fast, if you don’t create many objects by vbezhenar on Monday September 12, 2022 @09:34AM (#32809982)
It’s almost always at odds with performance.