rubinius @ rubyandrails2010

Post on 15-May-2015

885 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

RubiniusUse Ruby

1.1 is out!

2006

Let’s have funand write a new

interpreter!

2006

1.0 by end 2007!

2007

Ok, maybe not...

2010

1.0!

2 virtual machines

2 virtual machines

1.75 garbage collectors

2 virtual machines

1.75 garbage collectors

3 bytecode compilers

2 virtual machines

1.75 garbage collectors

3 bytecode compilers

1 Ruby core library

2 virtual machines

1.75 garbage collectors

3 bytecode compilers

1 Ruby core library

2 primitives systems

2 virtual machines

1.75 garbage collectors

3 bytecode compilers

1 Ruby core library

2 primitives systems

2 JIT compilers

Rubyspec

Ruby in Ruby

module Enumerable def collect if block_given? ary = [] each { |o| ary << yield(o) } ary else to_a end end

alias_method :map, :collectend

What is Rubinius these days?

Compacting generational

garbage collector

class Address attr_reader :street attr_reader :number attr_reader :cityend

Address.instance_variable_get("@seen_ivars")=> [:@street, :@number, :@city]

a = Address.newa.street = "Street"a.number = "1"a.city = "Enschede"

Rubinius.memory_size(a) => 56

Rubinius.memory_size(a) => 160

VS

JIT

InlineCache

module CoolModule def method1 1 + 1 endend

class CoolObject include CoolModuleend

CoolObject.new.method1

Call counting

def method1 1 + 1end

def method2 method1end

100.times do method2end

members of rubinius::VMMethod: total_args = 0, call_count = 21, llvm_function_ = 0x0, name_ = 0x6306,

RBXthread(s)

Go JIT!

Here it is!

LLVMthread

Debugging

DEMO

Profiling

DEMO

Contributing

26

3 legged dog turtles space shuttle rubinius

Performance

commit 5386d9299360b5f1ede14392b97da6dc7163ed00Author: Dirkjan Bussink <d.bussink@gmail.com>Date: Tue Jan 8 20:29:01 2008 +0100

Added Process::POSIX safety checks

diff --git a/kernel/core/process.rb b/kernel/core/process.rbindex fec15b6..ff50b49 100644--- a/kernel/core/process.rb+++ b/kernel/core/process.rb@@ -103,11 +103,15 @@ module Process end def self.getpgid(pid)- Platform::POSIX.getpgid(pid)+ ret = Platform::POSIX.getpgid(pid)+ Errno.handle if ret == -1+ ret end def self.setpgid(pid, int)- Platform::POSIX.setpgid(pid, int)+ ret = Platform::POSIX.setpgid(pid, int)+ Errno.handle if ret == -1+ ret end @maxgroups = 32

1 patch == commit access

rbx my_awesome_code.rb

Future

1.9

DEMO

So when will you

be a contributor?

top related