From: Mark Probert Date: 2003-01-03T09:47:20+09:00 Subject: [ANN] ratlast 0.3 Rubyists, I have just completed the 0.3 update of ratlast. You can find it at your favourite RAA or at http://www3.sympatico.ca/mark.probert/download/files/ratlast_0_3.tar.gz This update is a minor one that adds a few words to the ATLAST vocabulary (FILL, BYE, VERSION, NIP) plus quite a bit of cleaning up (mostly of the source code, some changes to the distribution). I have also included a command line version of ATLAST as well, to allow interactive testing. Some of the additions include some examples of FORTH in Ruby. Along this line, I have also done a little bit of benchmarking of native Ruby and ratlast. To do this, I have taken some of the code posted on Doug Bagely's Language Shootout site (http://www.bagley.org/~doug/shootout). I looked at three examples where Ruby performed rather poorly: Sieve of Eratosthenes, Random Number, and Array Access. My tests show a factor of between 5 to 7 by using ratlast. Here are the results: PROBERTM-2:# ruby bench_1.rb Count (Ruby) 100 iterations: 1028 Count (ratlast) 100 iterations: 1028 Random (ruby) 100000 iterations: 56.568644262 Random (ratlast) 100000 iterations: 56.568600000 Random (ruby) 1000 iterations: y[0]=1000 y[last]=1000000 Random (ratlast) 1000 iterations: y[0]=1000 y[last]=1000000 -------------------------------------------------- BenchTimer Report: -------------------------------------------------- Array Access (ratlast) 0.56s Array Access (ruby) 2.14s Random Number (ratlast) 0.12s Random Number (ruby) 0.73s Sieve of Eratosthenes (ratlast) 0.64s Sieve of Eratosthenes (ruby) 4.08s -------------------------------------------------- PROBERTM-2:# ruby -v ruby 1.7.3 (2002-11-17) [i386-mswin32] I have yet to check the speed increase if I were to do these benchmarks in C as extensions. I suspect that I would see another x5 or so, though it is very nice to have half this speed without having to compile anything. I have included the code for these benchmarks in the distribution. It includes the formatter called BenchTimer.rb. If you have any questions or suggestions, please feel free to email or post to this group. Happy New Year! Regards, -mark. (probertm@acm.org)