どれくらいの再帰呼び出しでスタックオーバーフローになるか

d.hatena.ne.jp

上のサイトで実験しているのに、RubyPython を追加しました。
OSは Linux Kernel 3.19.0、メモリは 7.7GB。

Python 3.4

ctr = 0
 
def testfunc():
    global ctr
    ctr += 1
    print ("%sth function call." % (ctr))
    testfunc()

testfunc()

Ruby 2.2

$ctr = 0

def testfunc
  $ctr += 1
  print "\e[1G#{$ctr}th function call."
  testfunc
end

testfunc


結果。Python は 997回、Ruby は10077回。