Upload
matt-aimonetti
View
4.628
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Is Ruby really slow? Why should I choose Merb?
Citation preview
&merb
f l e x i b i l t y p e r f o r m a n c e
Me
MeMatt
Aimonetti
irc: m a t t e t t ihttp://github.com/mattetti
Matt
Matt
d o n ’ t w o r kfor Engine Yard
Matt
d o n ’ t w o r kfor Engine Yard
MeC o n s u l t a n tbased in San Diego, CA
Blogs:http://merbist.com
http://railsontherun.com
“It’s also worth mentioning that there shouldn’t be doubt in anybody’s mind at this point that Ruby itself is slow. It’s great that people are hard at work on faster implementations of the language, but right now, it’s tough.”
Alex Payne, Twitter
I for one am scared of Ruby because ... it's known to be slow, so if you become The Next MySpace, you'll be buying 5 times as many boxes as the .NET guy down the hall.
Joel Spolsky
Rails is for the vast majority of web applications Fast Enough... I just happen to care much more about free developer cycles and am willing to trade the former for the latter.
David Heinemeier Hansson
Ruby is so embarrassing.
Rails is slow
Ruby is slow
“The slowest programming language in the world”
What does the community say?
Hardware cost
> Development cost
¡we program faster!
¿srly?
benchmarks someone?
raw PHP: 331 rps
raw PHP: 331 rps
cake PHP: 3.6 rps / 8 rps (eaccelerator)
raw PHP: 331 rps
cake PHP: 3.6 rps / 8 rps (eaccelerator)
code igniter:21.5 rps / 98.2 rps (eaccelerator)
raw PHP: 331 rps
cake PHP: 3.6 rps / 8 rps (eaccelerator)
code igniter:21.5 rps / 98.2 rps (eaccelerator)
Rails:88 rps
Rails with 1 mongrel is
pretty close to the fastest PHP framework.
what about merb?
hello world benchmarks
baseline results
Merb
merb requests per second
Merb Static HTML
requests per second
Merb Static HTML PHP
requests per second
Merb router Merb controller Sinatra Rails CakePHP
requests per second
We don’t need to be embarrassed
Ruby might be slow at fibonacci benchmarks
who cares?
Ruby is fast at real life web benchmarks
that’s what matters!
stop saying Ruby is slowbecause that’s not true
what about merb?because that’s why you’re here
merb is fast
merb is flexible
$ merb-gen app app-name
merb stack
merb-action-argsmerb-assets merb-cache
merb-helpers merb-mailer merb-slices merb-auth
merb-param-protectionmerb-exceptions
dm-core dm-aggregatesdm-migrationsdm-timestamps
dm-types dm-validations
$ merb-gen very_flat app-name
1 file
Merb::Router.prepare do match('/').to(:controller => 'very-flat-app', :action =>'index')end
class VeryFlatApp < Merb::Controller def index "Hi, I am 'very flat' Merb application. I have everything in one single file and well suited for dynamic stub pages." endend
$ merb-gen flat app-name
4 files
application.rb - controllers & actions
config/framework.rb - framework config
config/init.rb - app settings
views/view_name.html.erb - action view
$ merb-gen core app-name
no dependenciessame as merb stack app
when you don’t want DMwhen you use JRuby
when you want an opt-in solution
merb is modular
http://flickr.com/photos/ezzyponchi/283381271/ http://bonluxat.com
merb is agnostic
http://flickr.com/photos/24567277@
N00/2374743628/
merb can be opinionated
merb ♥ recycling
merb has an api
matz likes merb
Merb has a bright future for the people who are not satisfied by the
fixed ways in Rails.
I think that Merb will give users more freedom in a Ruby-ish
way of programming.
getting started
$ sudo gem install merb --development
$ merb-gen app my-first-app
$ merb-gen resource article title:string,author:string
merb 2.0
admin interface
rapid prototyping
e s
y
rapid deployment
e s
y
swiftiply
まつもとゆきひろ
Ruby 1.9 + i18n/l10n
2.0 schedule? in less than 12 months
questions?