3 ms·
> Saying that one isa is faster or more energy efficient is like saying that c++ syntax is faster than java syntax. I think that could be a valid statement. AP
by jpcfl 3y ago
> Saying that one isa is faster or more energy efficient is like saying that c++ syntax is faster than java syntax.
I think that could be a valid statement. APIs can influence performance by constraining the implementation. For instance, the syntax for constructing an object in C++ will, generally speaking, always yield faster code than Java, because Java objects are almost always allocated on the heap, while C++ objects can be allocated on the stack. Compare:
// C++
MyObj o{};
// vs. Java
MyObj o = new MyObj();
Sure, it's possible to write a Java allocator/GC that will yield similar performance to the C++ code, but in general, that will practically never be the case. The syntax of the language has constrained the implementation so that Java will practically always be slower. Presumably, similar design choices in an ISA could have the same effect.
- hardware2win 3y ago>Sure, it's possible to write a Java allocator/GC that will yield similar performance to the C++ code, Didnt you just agree with me that it is dependent on the impl/end product? Because what would be the reasons in isa world to make it not desirable >The syntax of the language has constrained the implementation so that Java will practically always be slower. The most interesting question is: by how much? 1% 3%? 30?
- o11c 3y agoJava code is generally 2x slower than C++ code, unless you're operating entirely on primitive types. The JIT usually can't remove enough of the gratuitous memory accesses the language forces.
- hardware2win 3y agoYoure talking about java end to end, we are talking about just syntax.
- jpcfl 3y ago> Didnt you just agree with me that it is dependent on the impl/end product? No. I'm saying that it may be theoretically possible to tune performance in some cases, but not practical.
- Pet_Ant 3y agoThe more bondage your language has the more information your compiler to make optimisations.