From: Charles Oliver Nutter Date: 2008-10-11T01:22:57+09:00 Subject: [ruby-core:19286] Re: performance of C function calls in 1.8 vs 1.9 SASADA Koichi wrote: > Charles Oliver Nutter wrote: >> Ruby 1.9 does seem to have some 'for' issues, though I'm admittedly a >> couple weeks behind: > > It is a known issue. > > > for e in expr do > ... > end > > #=> > > expr.each{|*args| > e = *args > ... > } > > all: > Any idea to omit making/extracting array? In JRuby we do the same, generally speaking, but we also special-case the single-arguent path, so that particular case doesn't build the array. So if only one arg is passed, it never becomes an array unless multiple assignment is involved. It may not be as fast as it could be though; dispatching to an empty block in YARV is still slightly faster. Does YARV optimize empty blocks away? - Charlie