Slide 1

Slide 1 text

The great Ruby Showdown How do the different Rubies out there perform with a non trivial ruby application? Chris Parsons - @chrismdp Wednesday, 22 February 12

Slide 2

Slide 2 text

Battleship http://github.com/ threedaymonk/ battleship Wednesday, 22 February 12

Slide 3

Slide 3 text

Only one round No display GuntherPlayer with fixed random seed Running on 2009 MBP http://github.com/ chrismdp/battleship My changes Wednesday, 22 February 12

Slide 4

Slide 4 text

Fixed random seed doesn’t work! Different Rubies do random differently Need to perform 50 ‘ticks’ instead Also different startup times was a headache Lessons Wednesday, 22 February 12

Slide 5

Slide 5 text

The players mri 1.8.7 mri 1.9.2 mri 1.9.3 jruby maglev rubinius macruby Wednesday, 22 February 12

Slide 6

Slide 6 text

Ruby 1.8.7 • No show - code doesn’t work • You shouldn’t be using it anyway • Ruby 1.9.2 has out and stable since summer 2010 Wednesday, 22 February 12

Slide 7

Slide 7 text

MacRuby 0.10 • Ruby based on the Objective-C Runtime • Long startup time • 442.65s (!!) • 431.90s (!!) Wednesday, 22 February 12

Slide 8

Slide 8 text

Rubinius (head) • Used: RBXOPT=-X19 rbx -v (can default to 1.9 too) • Long startup time • 56.41s • 52.35s • 90.16s (!) • 94.67s (!!) • 63.07s - very variable! Wednesday, 22 February 12

Slide 9

Slide 9 text

Maglev (head) • Based on vm-ware’s GemStone virtual machine • Can “transparently manage very large datasets” • 44.91s • 44.99s • 53.02s • 45.53s Wednesday, 22 February 12

Slide 10

Slide 10 text

Ruby 1.9.2 • The ‘standard’ during the tournament • Was focused on a ‘complete’ version of ruby 1.9 • 28.50s • 28.74s • 28.51s • 28.97s Wednesday, 22 February 12

Slide 11

Slide 11 text

Jruby (1.9) • A number of changes needed to the app Not an ‘out the box’ change, but still worked after tweaks. • Used: JRUBY_OPTS='--1.9 --server -J-Xmx1024m' • Long startup time: ~ 20-30 seconds • 25.93s • 25.05s • 27.60s • 26.26s Wednesday, 22 February 12

Slide 12

Slide 12 text

Ruby 1.9.3 • Better GC - doesn’t stop the world for as long • Focused on a better implementation rather than compliance • 23.64s • 23.80s • 26.30s • 24.67s Wednesday, 22 February 12

Slide 13

Slide 13 text

The Obligatory Graph mri 1.9.3 JRuby 1.9 mri 1.9.2 Maglev Rubinius mri 1.8.7 0 20 40 60 80 (lower is better) Wednesday, 22 February 12

Slide 14

Slide 14 text

The Obligatory Graph mri 1.9.3 JRuby 1.9 mri 1.9.2 Maglev Rubinius MacRuby 10 mri 1.8.7 0 125 250 375 500 (lower is better) Wednesday, 22 February 12

Slide 15

Slide 15 text

Conclusions Wednesday, 22 February 12

Slide 16

Slide 16 text

Use 1.9.3 Wednesday, 22 February 12

Slide 17

Slide 17 text

JRuby 1.9 Slow to start, but just as good Wednesday, 22 February 12

Slide 18

Slide 18 text

MRI 1.9.2 Ultra-stable Wednesday, 22 February 12

Slide 19

Slide 19 text

MacRuby Rubinius Need work Wednesday, 22 February 12

Slide 20

Slide 20 text

Maglev The new kid Looks promising Wednesday, 22 February 12

Slide 21

Slide 21 text

~ The End ~ Chris Parsons @chrismdp Wednesday, 22 February 12