Antonio Cuni wrote: > Jon Harrop wrote: > >> If you want to see how much of a benefit tail calls are in practice, look >> at .NET (which has had them for the best part of a decade). > > .NET tail calls are totally inefficient. Here is a benchmark to measure tail > vs non-tail calls: > http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.cs > > Of course C# doesn't allow to specify a call as tail, so I had to manually > patch the IL; here is the modified IL version: > http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.il > > And here is the final executable: > http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.exe > > On windows, the tail call is about 10 times *slower* than the normal call, > which is by itself 2 times slower than the for loop. >
...all of which basically means .NET tail calls are in the exact same situation as the functional JVM languages. ~~ Robert Fischer. Grails Training http://GroovyMag.com/training Smokejumper Consulting http://SmokejumperIT.com Enfranchised Mind Blog http://EnfranchisedMind.com/blog Check out my book, "Grails Persistence with GORM and GSQL"! http://www.smokejumperit.com/redirect.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---