Compared to equivalent Ruby, this C code is often more efficient for computationally intensive code.
However the interface that these C extensions provides is defined by the non-optimising reference implementation of Ruby.
C extensions are interpreted and dynamically optimised rather than being statically compiled, and the interface which the C code is programmed against is provided as an abstraction over the underlying implementation which can then independently specialise.
The techniques developed in this thesis have a significant impact on performance of both synthetic benchmarks and kernels from real-world Ruby programs.
Specialising Dynamic Techniques for Implementing The Ruby Programming Language (PDF) The work in my thesis was implemented as Truffle Ruby.
Research papers, blog posts, videos, slides etc are listed on that project page.
The implementation of Ruby which has been developed achieves an order of magnitude or better increase in performance compared to the next-best implementation.
In many cases the techniques are ‘zero-overhead’, in that the generated machine code is exactly the same for when the most dynamic features of Ruby are used, as when only static features are used.
It provides a high performance implementation of Ruby’s dynamic features, at the same time as providing a high performance implementation of C extensions.
The implementation provides a high level of compatibility with existing Ruby implementations and does not limit the available features in order to achieve high performance.