News for hackers. Stuff that matters.
Re:Why blocks make Ruby methods slower by 3pt14159 on Friday February 27, 2015 @01:35PM (#9120453)
If I'm reading this right, I think it is because they implemented it twice and once they did it in a less optimized way. Hopefully this will lead to a speedup.
Re:Why blocks make Ruby methods slower by saidajigumi on Friday February 27, 2015 @02:00PM (#9120620)
Perhaps it's more correct to say that one syntax permits an optimized path because the work of creating a full ruby-level Proc object can be omitted. So you'd only be able to optimize the explicit block parameter case further if MRI were able to determine additional cases where this optimization could safely be applied.

As another poster points out, JRuby seems to have a much lower relative overhead (~1.13x, IIRC), so there may or may not be optimization concepts there that can eventually be applied to MRI.