From: Aaron Smith Date: 2007-06-22T03:55:11+09:00 Subject: Re: Ruby extensions question.. unknown wrote: > On Jun 21, 10:22 am, Aaron Smith wrote: >> -- >> Posted viahttp://www.ruby-forum.com/. > > The performance improvement is not found in the Ruby interface to C > but rather in what is going on in the C code itself. > > Example: > > I write C code that does something computationally intensive - say it > takes about 1 hour to run. If I were to write a Ruby equivalent (only > in Ruby) then let's say that it takes 2 hours. But if I extend that C > code using the Ruby C API then my performance would be 1 hour plus > interface (rb_*) overhead - maybe on the order of a few seconds or > perhaps minutes. Thanks that helps. One more question. Maybe this will end up having the same answer.. But let's say I have an object that I pass to the ruby extension. and all operations in the C code i'm doing are on that object passed using rb_funcall, rb_iv_get, etc. is it still seeing performance gains with C? thanks -- Posted via http://www.ruby-forum.com/.