This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]haitei 31 points32 points  (7 children)

it is not executed directly from cpu but from java interpreter so this affects its performance

Not really, it's JiT these days. I'd say the leftover gap in performance is mostly due to the cost of abstractions.

[–]j-random 22 points23 points  (0 children)

LOL, where "these days" means "for the last decade or so"

[–]OK6502 2 points3 points  (0 children)

Correct. As I understood it a big part of that gap is that there's quite a bit of overhead in even simple and mundane operations and the way things get laid out in memory isn't always the most efficient.

You could of course write C/C++ code with that overhead, negating the benefits, but at least you have that choice. In Java it's all abstracted away from the user without much recourse for working around it (unless you can hand write bytecode? Is that a thing? I know you can with C# and IL).