Community
Participate
Working Groups
Binary operations are heavily overloaded method calls in the xbase library. This leads to an exponential number of type checks that has to happen for nested binary operations. I could be worthwhile to reconsider the linking of binary operations. Rather than having them as overloaded members in the Xbase library we should evaluate the benefit of a specialized resolution for binary operations, e.g. a hardcoded linking. Performance wise the impact could be tremendous (validate with ArithmeticExtensionsTest.testManyOperations_01()) Another benefit of this approach is that the xbase lib could become fully optional, e.g. if clients want to use Java8 lambdas they could easily avoid the xbase standard lib as a dependency if the operators were not baked into that lib. Overloading of operators should still be possible, though.
The following example causes Xtend 2.7.3 to crash the Eclipse process (heap memory overflow, UI becomes unresponsive). If that happens even for such small computations, we really need an improvement in this regard. private def calcEllipseOffset(double w, double h, double a) { if (w >= h) { val cosa = cos(a) return h / sqrt(1 - (1 - h * h / (w * w)) * cosa * cosa) } }