These are the slides of my talk at vienna.rb:
https://www.meetup.com/en-AU/vienna-rb/events/253616653/
How does TruffleRuby achieves great performance?
How does it understand Ruby code?
The first part of this talk explains how TruffleRuby compiles Ruby code.
Array and Hash are used in every Ruby program. Yet, current implementations either prevent the use of them in parallel (the global interpreter lock in MRI) or lack thread-safety guarantees (JRuby and Rubinius raise an exception on concurrent Array append).
This talk shows a technique to make Array and Hash thread-safe while enabling parallel access, with no penalty on single-threaded performance. In short, we keep the most important thread-safety guarantees of the global lock while allowing Ruby to scale up to tens of cores!