State of lambda forms stealing stack frames?
Jochen Theodorou
blackdrag at gmx.org
Fri Jan 3 02:59:04 PST 2014
Am 03.01.2014 11:31, schrieb Andrew Haley:
> On 12/19/2013 01:57 PM, Jochen Theodorou wrote:
>> Are there any real plans to improve the situation?
>
> Can you send a complete test case?
notice, this is in Groovy, not Java and will require the indy enabled
version of Groovy to expose the described behaviour.
Complete test:
//-------------------------- fib.groovy ---------------------
@groovy.transform.Memoized
BigInteger fib(BigInteger x) {
x<2?x:fib(x-1)+fib(x-2)
}
/* Standard Groovy can go to 292,
Groovy-indy with jdk7 below u25 to about the same
Groovy-indy with jdk8 or jdk7 using lambda forms to about 45
Therefore, the following line fail to complete with a
StackOverflowError depending on the java version as described
above.
*/
fib(100)
// --------------------------------------------------------
bye Jochen
--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org
More information about the lambda-dev
mailing list