An efficient and thread-safe object representation for JRuby+Truffle

An efficient and thread-safe object representation for JRuby+Truffle

This talk will discuss the representation of objects in dynamically-typed languages like Ruby. From the naive hash table used in ruby 1.8.7 to the highly optimized and type-specialized representation, we will take a look at a few common representations for objects with a dynamic number of fields. Advantages and drawbacks will be discussed and in particular the behavior of objects accessed concurrently. Would you expect instance variables to disappear? Or that writing to them would have no effect? If not, come and see why it could happen, and what can be done to fix it and at what cost!

JRuby+Truffle is a high performance implementation of Ruby being built as an open-source project at Oracle Labs. It uses state-of-the-art research techniques for writing interpreters and dynamic compilers that allows it to be both significantly faster and simpler than any other implementation of Ruby. It is built on top the of Truffle framework which provide an Object Storage Model. We present a solution to make it behave correctly under concurrent access.

0ea7f61aec8fee539be0cf39b7bab77c?s=128

Benoit Daloze

January 31, 2016
Tweet