pat eyler wrote:
> On 9/15/06, Kenosis <kenosis / gmail.com> wrote:
>> I can't recall whether I read about this on this site or in some
>> magazine article but I recall it being interesting to me: I think it
>> was called profile driven optimization.  My vague recollection is that
>> gcc can optimize based on a runtime profile.  So, you run ruby over
>> your application while profiling it all together, essentually profiling
>> ruby in the context of your application. Then you use the profile guide
>> gcc to rebuild a version of ruby optimized for your application.  Might
>> be worth some research.
> RedHat Magazine had an article on GCC optimizations that talked about
> this:
> 
> http://www.redhat.com/magazine/011sep05/features/gcc/
> 
> it's also a recurring topic at the GCC summit:
> http://www.gccsummit.org/2005/view_abstract.php?content_key=7
> http://www.gccsummit.org/2006/view_abstract.php?content_key=17
Well ... the good news is that I have gcc 4.1.1 and a "test suite"
consisting of a single benchmark, plus scripts to build Ruby and
YARV-Ruby with "gprof" enabled. The bad news is that I have very little
play time this weekend because I'm attending a couple of workshops on
... well ... other programming languages. :)

The test suite can be found at

http://rubyforge.org/cgi-bin/viewvc.cgi/MatrixBenchmark/?root=cougar

By the way, the kind of code I'm interested in running efficiently in
Ruby is well-represented by the matrix benchmark. Pretty much everything
I want to do can be expressed ultimately in terms of matrix
multiplication, and I'm on the verge of filing a Ruby Change Request to
get the Mathn, Rational, Complex and Matrix libraries coded up in C and
become part of the base Ruby language.

I'm well aware of the dozens of C and C++ math libraries that have been
interfaced with Ruby, and dozens more that *could* be interfaced, given
some love (and SWIG). :) However, the "pure Ruby" libraries I listed
above are exactly what I need.