More Related Content
Similar to Rubinius @ RubyAndRails2010
Similar to Rubinius @ RubyAndRails2010 (20)
Rubinius @ RubyAndRails2010
- 15. 2 virtual machines
1.75 garbage collectors
3 bytecode compilers
1 Ruby core library
2 primitives systems
2 JIT compilers
- 18. module Enumerable
def collect
if block_given?
ary = []
each { |o| ary << yield(o) }
ary
else
to_a
end
end
alias_method :map, :collect
end
- 23. class Address
attr_reader :street
attr_reader :number
attr_reader :city
end
Address.instance_variable_get("@seen_ivars")
=> [:@street, :@number, :@city]
- 24. a = Address.new
a.street = "Street"
a.number = "1"
a.city = "Enschede"
Rubinius.memory_size(a) => 56
VS
Rubinius.memory_size(a) => 160
- 27. module CoolModule
def method1
1 + 1
end
end
class CoolObject
include CoolModule
end
CoolObject.new.method1
- 29. def method1
1 + 1
end
def method2
method1
end
100.times do
method2
end
- 31. Go JIT!
RBX LLVM
thread(s) thread
Here it is!
- 37. 3 legged dog turtles space shuttle rubinius
Performance
26
- 38. commit 5386d9299360b5f1ede14392b97da6dc7163ed00
Author: 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.rb
index 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