From: MenTaLguY Date: 2007-06-22T04:28:35+09:00 Subject: Re: Ruby extensions question.. On Fri, 22 Jun 2007 03:55:11 +0900, Aaron Smith wrote: > 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? Usually not much. Local variables are a little cheaper, and there's no AST-walking for evaluation, but that's about the extent of it. Ruby method calls are a lot more expensive, so the big wins are when you can avoid Ruby method calls (i.e. rb_funcall) altogether. Otherwise, it's just not worth the maintainability and portability problems. -mental