• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mirah & Dubious Talk Ruby|Web 2010
 

Mirah & Dubious Talk Ruby|Web 2010

on

  • 1,370 views

 

Statistics

Views

Total Views
1,370
Views on SlideShare
1,366
Embed Views
4

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 4

http://speakerrate.com 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Mirah & Dubious Talk Ruby|Web 2010 Mirah & Dubious Talk Ruby|Web 2010 Presentation Transcript

    • Friday, September 10, 2010
    • Extreme Performance with Mirah and Dubious Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • Friday, September 10, 2010
    • JRuby on AppEngine It rocks, but has some limitations. Friday, September 10, 2010
    • Limitations • Not as supported as Java & Python • Long spin up times • Uses more CPU(more expensive) • getting more performance requires writing Java Friday, September 10, 2010
    • Spin Up • Rails app instances take a long time to spin up • you can’t keep app instances running (yet) Friday, September 10, 2010
    • Long Spin Up Times • Rails instances take 16 seconds or more to spin up • AppEngine limits requests to 30 seconds • Users will hit cold instances Friday, September 10, 2010
    • Spin Up Workarounds DeferredDispather • Splits Initialization into three requests(two redirect back) • runtime & rack • require app • dispatch normally Friday, September 10, 2010
    • Friday, September 10, 2010
    • CPU Usage • On AppEngine CPU == $$$$ • JRuby uses more CPU than Java or Python Friday, September 10, 2010
    • CPU Usage • On AppEngine CPU == $$$$ • JRuby uses more CPU than Java or Python Friday, September 10, 2010
    • JRuby on AppEngine Optimization 1. Write app in Rails 2. Find parts that are slow/get heavy traffic 3. Rewrite them with Java Servlets Friday, September 10, 2010
    • Kinda Sucks, Right? Friday, September 10, 2010
    • Enter Mirah & Dubious Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • Mirah (Duby) Friday, September 10, 2010
    • Mirah - Ruby in Javanese Friday, September 10, 2010
    • “Charles Oliver Nutter wanted to create a language that essentially looked like Ruby, but was statically typed and compiled to fast JVM bytecode. Mirah is the result.” - mirah.org Friday, September 10, 2010
    • Mirah • Uses Ruby syntax+types • Behaves like Java • Extensible through macros Friday, September 10, 2010
    • Features From Ruby • Optional arguments ✓ • Internal iteration ✓ • Closures ✓ • Literals ✓ • String interpolation ✓ • Mixins, “open” classes (soon) Friday, September 10, 2010
    • Ruby def fib(a)   if a < 2     a   else     fib(a - 1) + fib(a - 2)   end end Friday, September 10, 2010
    • Mirah github.com/mirah/mirah/examples/fib.mirah def fib(a:int)   if a < 2     a   else     fib(a - 1) + fib(a - 2)   end end Friday, September 10, 2010
    • Macros Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • Dubious Friday, September 10, 2010
    • Dubious A Web Framework in Mirah Friday, September 10, 2010
    • Friday, September 10, 2010
    • High Performance, Light weight, Rails like Friday, September 10, 2010
    • High Performance, Light weight, Rails like Friday, September 10, 2010
    • Written in Mirah, so it’s as fast as Java. Friday, September 10, 2010
    • App Instances Spin Up in ~1 sec Friday, September 10, 2010
    • High Performance, Light weight, Rails like Friday, September 10, 2010
    • Few Dependencies Friday, September 10, 2010
    • Examples Friday, September 10, 2010
    • High Performance, Light weight, Rails like Friday, September 10, 2010
    • import dubious.* import models.* class ContactsController < ApplicationController   # GET /contacts   def index     @contacts = Contact.all.run     render index_erb, main_erb   end   # GET /contacts/1   def show     @contact = Contact.get(params.id)     render show_erb, main_erb   end   # GET /contacts/new   def new     @contact = Contact.new     render new_erb, main_erb   end   # GET /contacts/1/edit   def edit     @contact = Contact.get(params.id) Friday, September 10, 2010
    • import dubious.* import models.* class ContactsController < ApplicationController   # GET /contacts   def index     @contacts = Contact.all.run     render index_erb, main_erb   end   # GET /contacts/1   def show     @contact = Contact.get(params.id)     render show_erb, main_erb   end   # GET /contacts/new   def new     @contact = Contact.new     render new_erb, main_erb   end   # GET /contacts/1/edit   def edit     @contact = Contact.get(params.id) Friday, September 10, 2010
    • import dubious.* import models.* class ContactsController < Appli   # GET /contacts   def index     @contacts = Contact.all.run     render index_erb, main_erb   end Friday, September 10, 2010
    •   end   # GET /contacts/new   def new     @contact = Contact.new     render new_erb, main_erb   end   # GET /contacts/1/edit   def edit     @contact = Contact.get(param     render edit_erb, main_erb   end Friday, September 10, 2010
    •   end   # render templates   def_edb(index_erb, 'views/contacts/index.html.erb')   def_edb(show_erb, 'views/contacts/show.html.erb')   def_edb(new_erb, 'views/contacts/new.html.erb')   def_edb(edit_erb, 'views/contacts/edit.html.erb')   def_edb(main_erb, 'views/layouts/contacts.html.erb') end Friday, September 10, 2010
    • import com.google.appengine.ext.duby.db.Model import com.google.appengine.api.datastore.* import dubious.TimeConversion import java.util.Date class Contact < Model   property :title, String   property :birthday, Date   property :url, Link   property :platform, String   property :editor, String   property :summary, Text   property :address, PostalAddress   property :phone, PhoneNumber   property :private, Boolean   # timestamps   property :created_at, Date   property :updated_at, Date   def before_save     @updated_at = Date.new     @created_at = updated_at if @created_at.nil?   end   def coerce_date(o:Object)     TimeConversion.new('jsdate').parse(String(o)) Friday, September 10, 2010   end
    • import com.google.appengine.ext.duby.db.Model import com.google.appengine.api.datastore.* import dubious.TimeConversion import java.util.Date class Contact < Model   property :title, String   property :birthday, Date   property :url, Link   property :platform, String   property :editor, String   property :summary, Text   property :address, PostalAddress   property :phone, PhoneNumber   property :private, Boolean   # timestamps   property :created_at, Date   property :updated_at, Date   def before_save     @updated_at = Date.new     @created_at = updated_at if @created_at.nil?   end   def coerce_date(o:Object)     TimeConversion.new('jsdate').parse(String(o)) Friday, September 10, 2010   end
    • <h1>New contact</h1> <% f = form_for(@contact) %>   <%= f.start_form %>   <%= f.error_messages %>   <p>     <%= f.label :title %><br />     <%= f.text_field :title %>   </p>   <p>     <%= f.label :summary %><br />     <%= f.text_area :summary %>   </p>   <p>     <%= f.label :birthday %><br />     <%= f.date_select :birthday %>   </p>   <p>     <%= f.label :platform %><br />     <%= f.radio_button :platform, 'Mac' %>Mac     <%= f.radio_button :platform, 'PC' %>PC     <%= f.radio_button :platform, 'Linux' %>Linux   </p>   <p>     <%= f.label :editor %><br />     <%= f.select :editor, ['Vim','Emacs','TextMate','Other' Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • • JRuby on AppEngine • Mirah • Dubious • Hack Friday, September 10, 2010
    • Get Started Demo Time Friday, September 10, 2010
    • Me Nick Howard Avid Rubyist Commiter on Dubious @baroquebobcat Work at Gnip in Boulder, CO Friday, September 10, 2010
    • Contribute Mirah & Dubious mirah.org Code github.com/mirah/mirah github.com/mirah/dubious Examples rails-annex.appspot.com dubious-demo.appspot.com Mailing List groups.google.com/group/mirah Friday, September 10, 2010