On Tuesday 22 April 2008 19:11:28 Antonio Cuni wrote:
> Honestly, I doubt that a tail call can be faster/much faster than a
> plain for loop, but we should do some benchmark of course.
Yes. However, tail calls are not restricted to the body of a single method.
> > CLR: 0.025s
>
> how does this compare with the first version of the loop you wrote?
>
> void run() {
> for (int i=0; i<3; ++i)
> if (foo(i) == 0) break;
> bar();
> baz();
> }
25ms with tail calls drops to 7ms with "break" on the CLR, 10ms for break on
the JVM.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---