From: <da...@de...> - 2004-01-13 17:07:45
|
gabriele renzi <sur...@ya...> writes: > > ruby1.7 ./ackermann.ruby 7 > > With '8' even 1.7 fails. > DOH! > I meant: > loser@irc:~$ ruby ack.rb 8 > Ack(3,8): 2045 > (I did this even the first time, just copy/pasted a previous block > :) > I still believe this relates to current stack size limit for the > process in wich the interpreter is run: @eugene [~/workshop/scutigena/tests/ruby/common/src] $ ruby1.8 ackermann.ruby 7 ackermann.ruby:8:in `ack': stack level too deep (SystemStackError) @eugene [~/workshop/scutigena/tests/ruby/common/src] $ ulimit unlimited So... I don't know! > <snip> > > > to avoid name search at any run, given that > > gen_random is already > > > available in current module, that makes little > > sense to me :/ > > Seems odd to me too. Does it run ok without 'gr = > > gen_random' ? > sure ;) GR: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.222s user 0m7.170s sys 0m0.050s GR: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.232s user 0m7.220s sys 0m0.010s GEN_RANDOM: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.807s user 0m7.520s sys 0m0.010s GEN_RANDOM: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.540s user 0m7.500s sys 0m0.020s GEN_RANDOM: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.519s user 0m7.490s sys 0m0.030s GR: @ashland [~/workshop/scutigena/tests/python/common/src] $ time python2.3 random.python 1000000 81.465763603 real 0m7.258s user 0m7.240s sys 0m0.020s Using 'gr = gen_random' seems to be just a tiny bit faster, so I'll leave the code the way it is. -- David N. Welton Consulting: http://www.dedasys.com/ Personal: http://www.dedasys.com/davidw/ Free Software: http://www.dedasys.com/freesoftware/ Apache Tcl: http://tcl.apache.org/ |