Benoit Daloze
Benoit Daloze
  • @eregontp

Benoit Daloze is the TruffleRuby lead. He has contributed to many Ruby implementations, including MRI, TruffleRuby and JRuby. He is the maintainer of ruby/spec, a test suite for the behavior of the Ruby programming language.

Splitting: the Crucial Optimization for Ruby Blocks

Blocks are one of the most expressive parts of the Ruby syntax. Many Ruby methods take a block. When a method is given different blocks, there is a crucial optimization necessary to unlock the best performance. This optimization dates back to the early days of research on dynamic languages, yet it seems only a single Ruby implementation currently uses it. This optimization is called splitting and what it does is using different copies of a method and specialize them to the block given at different call sites. This enables compiling the method and the block together for the best performance.

Presentation Material