implementation of ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfyugui-san (release...

67
Implementation of Ruby 1.9.3 and later Koichi Sasada Department of Creative Informatics, Graduate School of Information Science and Technology, The University of Tokyo 1

Upload: others

Post on 23-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Implementation of Ruby 1.9.3 and later

Koichi Sasada Department of Creative Informatics,

Graduate School of Information Science and Technology,

The University of Tokyo

1

Page 2: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Today’s topic

Ruby 1.9.3

Next and next version of MRI

2

Page 3: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

We released!

Ruby 1.9.3 …rc1

3

Page 4: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Yugui-san (release manager) says …

“I will release Ruby 1.9.3 within this

two weeks unless any serious problem is

reported. If you have any trouble with

Ruby 1.9.3, please let us know.”

It’s means…

4

Page 5: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

We need human sacrifice

5

http://www.flickr.com/photos/babomike/4741964697/

Page 6: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 1.9.3 New Features

RTFN Read the F*****g News

6

Page 7: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 1.9.3 Features

License

Original and (GPLv2 → 2-clause BSDL)

Syntax, Methods/Libraries

Private constants

DL/YAML → Fiddle/Psyck

Test::Unit → Parallel extension (by @sora_h, talking at next room)

String#prepend, IO.write, etc

… (Actually, I don’t know about Ruby world) 7

Page 8: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Implementation of

Ruby 1.9.3

Internals and later

Koichi Sasada Department of Creative Informatics,

Graduate School of Information Science and Technology,

The University of Tokyo

8

Page 9: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 1.9.3 Interpreter internals

Garbage Collection

• Lazy Sweep

• Parameter tuning

Timer thread implementation

• Reducing power consumption

GVL implementation for multi-core

• Solve an problem about non-thread switching on multi-core

9

Page 10: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Garbage Collection

10 http://www.flickr.com/photos/ninithedreamer/4649075746/

Page 11: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Introducing Lazy Sweep GC

Before 1.9.3: Stop the world mark and sweep

After 1.9.3: Stop the world mark, and incremental sweep

11

Ruby Mark Sweep Ruby execution

Stop the (Ruby) World

Ruby Mark Sweep

Ruby execution with

incremental sweep

(shorter stopping time)

Stop the (Ruby)

World

Sweep Sweep Sweep Sweep

Shorter

stop time

Page 12: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Garbage collection Parameter tuning

12

Read a source code for details :p

Quoted from nari3’s slide

Page 13: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 1.9.3 All About Timer Thread

(core, details)

Koichi Sasada Department of Creative Informatics,

Graduate School of

Information Science and Technology,

The University of Tokyo

13

Recycle Presentation

@RubyKaigi2011, again

Page 14: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Power consumption

14 http://www.flickr.com/photos/livingos/2494500294/

Page 15: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Background Timer Thread?

Timer thread is an internal mechanism on Ruby 1.9

For thread scheduling

For signal delivery

15

Timer

thread

Ruby

thread 1

Wake up Wake up Wake up

Ruby

thread 2

Pass the GVL Pass the GVL Pass the GVL

tell the timing tell the timing tell the timing

Page 16: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Problem Power Consumption?

Timer thread awake every 10ms

To notify a running thread to release GVL

Wake-up anytime even if it is not necessary (no

scheduling is needed) → CPU can’t sleep enough

A few people claimed that the timer thread consumes power

16

Timer

thread

Ruby

thread

(sleeping)

Wake up Wake up Wake up

10ms 10ms

Page 17: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Solution Rewrite Timer Thread Code

Make timer thread more smart

Timer thread sleeps infinitely if only one thread is needed

Using pipe trick

17

Timer

thread

Ruby

thread 1

Wake up Wake up

10ms

Ruby

thread 2

Pass the GVL

tell the timing

Create new thread

Start

periodical

wake up

Page 18: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation (?) Power consumption

18

50

51

52

53

54

55

56

57

58

59

60

W 1.9.2

proposed

0 1 2 4 8 16 32 64 128

Page 19: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation

0

10

20

30

40

50

60

70

80

90

100

1.9.2

proposed

0 1 2 4 8 16 32 64 128

Reduce 0.3W

on 1 Ruby process

19

Page 20: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Caution! Incompatibility

Pipe trick needs additional file descriptors

You should not close them

Passenger does it!!

Skip to close such file descriptors w/ new C API “rb_reserved_fd_p()”

20

Page 21: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Thread Scheduler on the multi-core

21 http://www.flickr.com/photos/marksze/4231114748/

Page 22: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

22

Ruby 1.9.3 GVLおよびロックの改善

GVL and Lock improvement

Fujitsu

Motohiro Kosaki

Recycle Presentation

@RubyKaigi2011 by Kosaki-san

He is a

Ruby and

Linux kernel

committer

Page 23: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Background again Only one thread can run w/GVL

Timer thread is an internal mechanism on Ruby 1.9

For thread scheduling

For signal delivery

23

Timer

thread

Ruby

thread 1

Wake up Wake up Wake up

Ruby

thread 2

Pass the GVL Pass the GVL Pass the GVL

tell the timing tell the timing tell the timing

Page 24: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Doesn’t work some program on Multi-core environment

24

# example

f = false

Thread.new {

....;

f = true

}

Thread.pass until f

Page 25: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Why?

25

Page 26: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Good old OS scheduler

26

core

Thread Thread Thread

Only one Queue Thread

core

Thread

core

Thread

Quoted from Kosaki-san’s slide

Page 27: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

New fast OS scheduler

27

core Thread

Thread

core

Thread

core

Thread

Thread

Thread

Same number of CPU

cores

Thread

Quoted from Kosaki-san’s slide

Page 28: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Situation (1)

28

core Thread

Thread 1

Ruby

Thread1

core

Thread

Ruby

Thread2

Yield! Return into Queue

( ^ω^) I can expect resume!

Quoted from Kosaki-san’s slide

Page 29: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Situation (2)

29

core Thread

Thread 1

Ruby

Thread1

core

Thread

Ruby

Thread2

Head of

Queue

Resume

again!

(´・ω・`) I can’t resume again…

Quoted from Kosaki-san’s slide

Page 30: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Solution

We change GVL passing strategy

Passing GVL definitely

Ask me later if you want to know

30

gvl_acquire

mutex_lock(&lock->lock)

cond_wait(&lock->wait)

lock->acquired = 1;

// notice

cond_signal(&lock->switch_cond)

mutex_unlock(&lock->lock)

mutex_lock(&lock->lock)

lock->acquired = 0;

cond_signal(&lock->wait_cond)

// sleeping until

cond_wait(&lock->switch_cond)

mutex_unlock(&lock->lock)

gvl_release

Quoted from Kosaki-san’s slide

Page 31: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Thread related performance

31 Quoted from Kosaki-san’s slide

Page 32: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Future

32

http://www.flickr.com/photos/viernullvier/5698630227/

Page 33: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Implementation of Ruby 1.9.3

and later Koichi Sasada

Department of Creative Informatics, Graduate School of

Information Science and Technology, The University of Tokyo

33

Page 34: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 1.9.4? Ruby 2.0?

Now discussing which version should be released

• Matz says “Next version is 2.0 including several new syntax” • keyword argument support for method definitions • Module#mix • Module#prepend • and others (refinement, classbox, or method shelter?)

• Another says “Should be 1.9.4”

34

Page 35: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ruby 2.0? What feature do you want?

Teach me here,

raise your hand! Anything is okay.

35

Page 36: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

OKay.

There are many requirements.

36

Page 37: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Ask Matz

Yesterday, I asked Matz what should we do. He doesn’t want to release 1.9.4 anymore. He want to say there are no progress in 1.9

series any more, but only in 2.0 series.

If spec is concluded, he shrink 2.0 spec and release force.

Please ask Matz tomorrow,

if you have opinion about it. 37

Page 38: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

My concerns on next version

Performance This is why I’m here

Profiler/debugger interface Please teach me what information you want to know!

Compiling supports

I’ll introduce several possibility and activities about “Ruby in Future”

38

Page 39: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Profiling / Debugging support

We add more support for profiling/debuggin

Please teach me what information you want to know!

39

Page 40: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

ObjectSpace.reference_from(obj)

2 days ago, I posted a patch of ObjectSpace.reference_from(obj)

• I’m sad there are few feedback…

40

obj x

y

ObjectSpace.reference_from(obj)

#=>

{98752943875 => x,

48334232r23 => y}

# keys are object id

# value are object themselves

Page 41: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Research of my student: Performance profiler

ll-prof

Real-time profiler for LL languages

•Ruby and Python (he is Pythonian)

Viewer in JavaScript

•You can see results in you browser

41

Ruby Profiler Collector Browser

Browser

TCP/IP

HTTP

Page 42: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Demo (movie made by student)

42

Page 43: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance

Speed

VM w/ runtime performance

GC performance

Memory consumption

Power consumption

43

Page 44: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance VM w/ runtime speed

Performance improvements VM

Easy escape analysis to prevent generating temporary objects

44

Page 45: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance VM w/ runtime speed

Semi-automatic Type inference and translate Ruby code into C (C extension)

45

Page 46: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Student’s research: CastOff A performance improvement tool for ruby1.9.3

Programmer

require ‘cast_off’

CastOff.compile(

Klass,

:Method,

binding,

TypeInfo) …

(1) Use from

ruby script •Compile

Klass#Method

•Load compiled binary

•Run faster

Programmer

(2) Use from

command line •Run and Profile

“program”

•Compile methods

in “program”

•Run faster

$ CastOff

“program”

Quoted from Shiba-san’s slide

Page 47: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Compilation flow

47

C build

tools

Code

Manage

r

Code

Generato

r

.conf .conf .conf

Configuratio

n

C

Extentio

n

C

Source Makefile

Configuration

Ruby program

Compilation

Target

# Tuning code

class Sample

CastOff.compile(

self, :sample,

binding,

:f => Foo)

end

Quoted from Shiba-san’s slide

Page 48: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance improvements

faste

r

Execution time ratio(CRuby 1.9.3 / CastOff)

0102030405060708090

Guard NoGuard

0

1

2

3

4

5

6

7

bm_sieve.rb bm_lists.rb0

0.2

0.4

0.6

0.8

1

1.2

bm_rdoc

Quoted from Shiba-san’s slide

Page 49: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance Garbage collection

MRI/CRuby’s GC is slow Stop the world and mark all

Generational? Issue: C extension compatibility

Ideas Parallel GC → Yesterday’s nari3’s talk Escape analysis and reduce GC managed objects

Smart data-structure to reduce GC managed objects

49

Page 50: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance Memory consumption

One Rails app consume 100MB

→ Encourage sharing resources

such as Strings, Arrays, and so on

REE/Kiji CoW friendly, generational

50

Page 51: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance Power consumption

Time thread modification at 1.9.3 → small one

More aggressive way?

51

Page 52: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Performance Parallel computing

52 http://www.flickr.com/photos/juror8/394285511/

Page 53: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Parallel Execution

Run threads in parallel (JRuby, MacRuby, …)

Good: Well known approach

Bad: Difficult to make safe/correct multi-threaded programs

• Many tragedy (in Java, etc.)

Bad: Difficult to make efficient implementation with fine-grain lock

Parallel processes (dRuby, …)

Good: No need to implement

Bad: Marshal overheads

53

Page 54: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Support friendly Coarse-grained parallel computing

Encourage Multi-process

Traditional well-known approach

Toward advanced dRuby

Multi-VM

VMs in one process

Light-weight communication

54

Page 55: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Student’s reseach Tunnel: Inter-process

communication w/shared memory

Object transfer w/ shared memory

55 Quoted from Nkagawa-san’s slide

Page 56: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Student reserch (cont.) Space: Inter-process

Space w/shared memory

56

Shared space between ruby processes

Similar to Linda/Rinda

Quoted from Nkagawa-san’s slide

Page 57: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation of Tunnel

57 Quoted from Nkagawa-san’s slide

Page 58: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

MVM

A.k.a. vaperware

We have progress on it, this year. 58

Page 59: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Parallel Execution Multiple-VM (MVM) on Ruby

Multiple VMs in one process

VMs are completely isolated (Each VM has an independent object space (heap))

VMs run in parallel

• Each VM has own GVL (w/o fine grained lock)

Ruby process

Ruby VM Ruby VM

Channel

- Passing

References

- Memory copy

Threa

d

Threa

d

Serial execution w/GVL

GV

L

Thread Thread

GV

L

59

Page 60: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Our Approach Multiple-VM (MVM) on Ruby

Channel: Inter-VM Communication mechanism

The only way to communicate with other VMs

Simply passing references or copying memory in the same address space

Ruby process

Ruby VM Ruby VM

Channel

- Passing

References

- Memory copy

Threa

d

Threa

d

Serial execution w/GVL

GV

L

Thread Thread

GV

L

60

Share the same address space

Page 61: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation HTML rendering app

Master dispatch string to worker and worker returns rendered HTML.

61

61

Ruby process

Master VM Worker VM String

Rendered

HTML

Page 62: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation HTML rendering app

62

0

1

2

3

4

5

6

7

8

9

0 5 10 15 20 25 30

Sp

ee

du

p r

ati

o

# of VMs/Processes

Processes+pipe

MVM+channel

Page 63: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Benchmark assuming web application

Several front-end VMs and one DB VM

YUBIN-Number (zip-code) DB on memory

Using dRuby (w/MVM) framework

63

Evaluation DB app

63

Ruby process

DB VM Front-end VM Query

String

(YUBIN#)

Result

String

(Address)

On memory

YUBIN# DB

Page 64: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Evaluation DB app

64

Query/sec

Page 65: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Future work

Extend this communication channel between inter-process (w/ shared memory), inter-node

Migratable Ruby activity (threads, blocks (closures) and so on)

65

Node

Ruby Process

VM VM Thread

Thread

Thread

Thread

Ruby Process

VM VM Thread

Thread

Thread

Thread

Node

Ruby Process

VM VM Thread

Thread

Thread

Thread

(Abstract)

Shared Object Space

Channel Channel

Channel

shared

object

shared

object

Page 66: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

Summary

Ruby 1.9.3 will be released soon!

Be Sacrifice!

NEWS file and blog posts are good to know

changes

This talk introduces background on Ruby 1.9.3

We are continuing the hacking to the future

Stay tuned to the next announcement

66

Page 67: Implementation of Ruby 1.9.3 and laterko1/activities/rubyconf2011_ko1_pub.pdfYugui-san (release manager) says … “I will release Ruby 1.9.3 within this two weeks unless any serious

おしまい Thank you for your attention

67

Implementation of

Ruby 1.9.3

and later ささだこういち

[email protected], [email protected]