This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Ruby/gcc vs Ruby/Forte
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
A funny thing happened after I totally hosed my Sun box and reloaded everything from scratch: I was able to build Ruby 1.8.2 with the Forte 6 compiler. I have no idea what I messed up last time, but it works now.
Anyway, I decided to install 2 different versions of Ruby and see how they fared when I ran them against the benchmark suite. The result? Ruby compiled with "gcc -Wall -fno-strict-aliasing" (version 3.4.3) fared better or equal to "cc -fast" (Forte 6, update 1) in all tests except one loop test (the 'while' test). The difference wasn't huge, mind you, but it was consistent.
I should note that I built Ruby with just a plain 'cc' command (i.e. no '-fast') and the performance was about half of the gcc version. So, if you're going to build Ruby with Forte, be sure to at least use '-fast'. :)
Perhaps there are some command line options I could pass to cc that would tweak things even more in favor of Forte, but I'm not experienced enough to know what they are. In any case, this puts a rather large hole in the theory that Forte builds better/faster code than gcc.