From: "M. Edward (Ed) Borasky" Date: 2006-07-16T12:41:41+09:00 Subject: Re: How to speed up ruby and make it as fast as possible William James wrote: > gforth uses special features of gcc to achieve high speed. > A post from comp.lang.forth > (topic: Question from a newcomer - regarding words): > > >> The default Debian gforth install they are using is still not turning >> on many optimizations. >> > > Actually the way that Gforth was built for Debian, even optimizations > that you don't have to turn on are disabled, in particular, dynamic > superinstructions. This causes Gforth to drop down in the CPU time > rank, but it helps in the memory consumption rank. > > To give you an idea of how much this can hurt, here are the standard > Gforth benchmark numbers for 0.6.2 on a 2.26GHz Pentium 4: > > siev bubble matrix fib > 0.23 0.28 0.19 0.34 gcc-2.95.1; gforth-0.6.2 --enable-force-reg > 0.79 1.01 1.11 1.14 Debian gforth 0.6.2-4 > Comments: 1. The "enable-force-reg" optimization has some risks on some architectures. I'm not at all familiar with the details, I just know that the Gentoo "gforth" package issues warnings if you choose that optimization. And gcc 2.95 probably isn't the compiler you want to be using. (You probably don't want to be using gcc 4 either, unless you're on a 64-bit real machine, but that's another ball of snakes.) 2. There is/was a project to build a Ruby virtual machine using the "gforth-like" technology "vmgen". IIRC "vmgen" is part of the gforth package, as is the documentation on it, so if you have gforth you probably have vmgen as well. 3. Most of the Ruby VM activity these days seems to be in three other areas: YARV, Cardinal (Ruby hosted by Parrot) and JRuby (Ruby hosted by the JVM). The "vmgen" based project is in the round-off noise. "vmgen" performs much better when the virtual machine is stack-based rather than register-based, and I'm not sure which is optimal for the Ruby language. My best guess is that YARV is the horse to bet on ... assuming, as I don't, that a VM is the best route to Ruby speed. :)