paulp/scala — comment on commit f6708722593d69a2f68fb91d4605cc1b680a0891
File:  line 0
By dcsobral:

Ok, this works in the sense that it produces correct results. However, even very simple code does not get inlined (see example below) and, even worse, it's performance is actually 8 times slower than what we currently have, and 10 times slower than my own version. Again, I dislike that subtract/add trick, but it works per JLS rules. I'm pretty sure hash algorithms depend on that too.

Example of code that does not get inlined with -optimise:

class XXS {
private val array = Array.range(0, 100)
def tst = { var sum = 0; for (i <- 0 until array.length) sum += array(i); sum }
}