Archive for March 2007
Got back from Mountain West RubyConf (MWRC) Saturday night. It was quite a fun rubyconf. The talks were by and large good, and there was lots of socializing (ie. networking), which is always one of the biggest reasons I go to conferences.
I was on a ruby implementors panel with the JRuby guys (Charlie and Tom), the CLR guy (John), and the Parrot guy (Kevin). It was fun, we just took questions from the audience and discussed them. It was all recorded, so I’ll be sure to post the link once the videos are up.
I got the word out about rubinius quite a bit and I’m really pleased at how interested people are in it. I got everything from “How does your garbage collector work?” to “I’d love to help, but I know crap about VMs”, which tells me that the project is appealing to not just VM geeks, but the normal programmer as well.
Pat Eyler and I talked briefly about setting up a release schedule for rubinius, working toward the 1.0 release in October. I’m pretty sold on it and I’ll be posting details in a bit, once I nail down the dates.
I’m very happy to announce I’ve just committed revision 809, which contains subtend, the rubinius C extension interface. It’s modeled after the MRI C interface, to allow most if not all C extensions that run under MRI to compile and run under rubinius.
Techy details: While subtend sports the same C API we’ve all grown to love from MRI, under the hood it is quite different. To properly support the accurate garbage collector, subtend uses a handle abstraction layer for object references the C code holds, which allows the VM to remain flexible with regard to object allocation and movement. Probably the thing I’m most proud of is that it allows C code to call back into ruby code without enlarging the C stack. I’ll talk more about that later. Come celebrate with us in #rubinius on freenode.net!
Too long since the last posts, I need to figure out how to make sure I do at least one post a week.
Anyway, since last time, rubinius has evolved more is really beginning to grow into it’s own. The denizens of #rubinius have been working hard, building up the core library. In the meantime, I’ve continued to work on the VM backend.
I’ve made a number of performance changes in the last month. The first was speeding up how stack frames (MethodContext) were created. They’re now opaque objects so that the VM can manipulate them much more quickly. There is still some work to do in that department as well, mainly in cache contexts rather than just throwing them away everytime.
Next, I went through and made a bunch of changes to how the C code is generated by tweaking the GCC options. That alone sped the VM up by about 200%. GCC now properly inlines the critical VM sections, which is a big boost.
I also added 2 method selector caches. MSC’s speed up method dispatch a lot because they save you have having to traverse all around any number of classes to find the proper method to call. The first cache is a global cache like 1.8 sports currently. It boosted performance by another 100% probably. I’ve now begun experimenting with inline caching. Inline caches stash the last method that was called at a call site so it can be used again. I’ve implemented inline caches for both method calling and access of constants. The inline caches are currently make a small performance improvement over the global cache, but I need to write some good benchmarks to get some decent numbers for comparison.
My current task is to get the interface for calling back into C code finished and commited. It’s going well and is going to use C/Invoke to speed up calling these functions. I’m particularly proud of the design, it’s going to allow the VM to remain stackless (ie, doesn’t use C stack to call methods) yet the C code can call back into ruby code.
Lastly, i’ve created a tumblr. Check it out!