From: "Marcin Mielżyński" Date: 2008-04-01T02:45:09+09:00 Subject: Re: Why Ruby do not optimize code at all? ts pisze: > Park Heesob wrote: >> So ruby is never fast but flexible language :) > > Well I can give you another example of "premature" optimisation, but > for 1.9 > > [ruby-bugs:16163] > > > http://rubyforge.org/tracker/index.php?func=detail&aid=16163&group_id=426&atid=1698 > > it worked but a modification was made to ruby and the optimisation > break the code now > > It's not a premature optimisation, just unimplemented yet fallback with /* TODO: if some === method is overrided */ comment in the source (insns.def) for opt_case_dispatch specialized instruction (very easy to accomplish having vm_opt_method_table and ruby_vm_redefined_flag). For some time there's been similar issue though for case: a = 0 10.times do |i| class Fixnum private :+ end a+=i end Where private didn't record redefined bit in ruby_vm_redefined_flag (vm.c). Now it's fixed and checked against in rb_export_method (eval_method.c) and rb_vm_check_redefinition_opt_method (vm.c). So all standard ruby semantics is still obeyed without sacrificing 1.9 performance. lopex