Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Topaz is in Ruby Python
Slide 2
Slide 2 text
Hi, my name is Jan Stępień
Slide 3
Slide 3 text
Topaz is a Ruby implementation written in Python
Slide 4
Slide 4 text
Topaz is a Ruby implementation which is faster
Slide 5
Slide 5 text
Ruby Topaz is a bird from South America
Slide 6
Slide 6 text
cc-by-sa-3.0 geimfyglið
Slide 7
Slide 7 text
Topaz is in Ruby Python
Slide 8
Slide 8 text
cc-by-sa-3.0 geimfyglið
Slide 9
Slide 9 text
cc-by-nc-sa-2.0 marie
Slide 10
Slide 10 text
Why? would you implement Ruby in Python?
Slide 11
Slide 11 text
Python CPython PyPy
Slide 12
Slide 12 text
Ruby MRI JRuby Rubinius
Slide 13
Slide 13 text
PyPy is a Python implementation
Slide 14
Slide 14 text
PyPy is amazingly fast See http://speed.pypy.org
Slide 15
Slide 15 text
PyPy is written in RPython
Slide 16
Slide 16 text
RPython is a subset of Python
Slide 17
Slide 17 text
RPython can be statically compiled to C
Slide 18
Slide 18 text
RPython is optimised for implementing VMs
Slide 19
Slide 19 text
PyPy is an impl. of Python PyPy is written in RPython RPython is compiled to C
Slide 20
Slide 20 text
Topaz is an impl. of Ruby Topaz is written in RPython RPython is compiled to C
Slide 21
Slide 21 text
git clone http://github.com/topazproject/topaz
Slide 22
Slide 22 text
$ cd topaz && cloc . Language files code Python 132 22934 Ruby 35 5058
Slide 23
Slide 23 text
$ time ./bin/topaz_untranslated.py 3.times { puts :hello } ˆD hello hello hello real 0m3.539s
Slide 24
Slide 24 text
$ cd topaz $ python \ .../pypy/rpython/bin/rpython \ -Ojit targettopaz.py RPython → C
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
$ time ./bin/topaz 3.times { puts :hello } ˆD hello hello hello real 0m0.050s
Slide 27
Slide 27 text
freqs = [0] * 256 while buf = $stdin.read(8192) buf.bytes.each do |b| freqs[b] += 1 end end p freqs
Slide 28
Slide 28 text
MRI 2.0 36,1 s 5,0 MB/s JRuby 1.7.2 24,8 s 7,3 MB/s Topaz 3,3 s 55,3 MB/s 180MB of data served from caches
Slide 29
Slide 29 text
50 100 150 Input size [MB] 10 30 20 0 Time [s] M RI JRuby Topaz
Slide 30
Slide 30 text
Topaz redefines what fast means in the Ruby world
Slide 31
Slide 31 text
Why is it so fast? PyPy!
Slide 32
Slide 32 text
Meta-tracing just-in-time compilation
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
Get the source and try for yourself
Slide 35
Slide 35 text
Is Topaz a Ruby-Python interoperability bridge? No, unfortunately it’s not.
Slide 36
Slide 36 text
Topaz is still very young
Slide 37
Slide 37 text
Contributing is easy
Slide 38
Slide 38 text
See also 096 RR Topaz with Alex Gaynor Introducing Topaz – Tim Felgentreff topazruby.com
Slide 39
Slide 39 text
dankeschön dziękuję ślicznie