Skip to content

Instantly share code, notes, and snippets.

@mergulhao
Created July 22, 2011 12:46
Show Gist options
  • Save mergulhao/1099382 to your computer and use it in GitHub Desktop.
Save mergulhao/1099382 to your computer and use it in GitHub Desktop.
Alguém tem algum benchmark real de uma app que *em produção* apresentou ganho de performance ao migrar para ruby 1.9? A gente que gosta de tecnologia quer estar sempre no "cutting edge", mas ainda não vi nenhum bench convincente, posso apenas não ter procurado direito. Todas as minhas apps até hoje rodam em 1.8, exceto algumas estão rodando no Heroku, que estão no 1.9.
Segue a instalação do ruby 1.9 usando pacotes nativos do Ubuntu. Reparem que apesar do nome do pacote, a versão instalada é a 1.9.2, como pode ser visto no final.
====================================
railsapps@webby5973:~$ sudo apt-get install ruby1.9.1-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.35-22-server linux-headers-2.6.35-22
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libruby1.9.1-dbg libtcltk-ruby1.9.1 ri1.9.1 ruby1.9.1-dev ruby1.9.1-examples
Suggested packages:
ruby1.9.1-elisp
The following NEW packages will be installed:
libruby1.9.1-dbg libtcltk-ruby1.9.1 ri1.9.1 ruby1.9.1-dev ruby1.9.1-examples ruby1.9.1-full
0 upgraded, 6 newly installed, 0 to remove and 47 not upgraded.
Need to get 7155kB of archives.
After this operation, 67.8MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/universe libtcltk-ruby1.9.1 amd64 1.9.2.0-1 [1791kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ maverick/universe ri1.9.1 all 1.9.2.0-1 [1353kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ maverick/universe ruby1.9.1-dev amd64 1.9.2.0-1 [1142kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ maverick/universe ruby1.9.1-examples all 1.9.2.0-1 [81.7kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ maverick/universe libruby1.9.1-dbg amd64 1.9.2.0-1 [2784kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ maverick/universe ruby1.9.1-full all 1.9.2.0-1 [2608B]
Fetched 7155kB in 2s (3002kB/s)
Selecting previously deselected package libtcltk-ruby1.9.1.
(Reading database ... 83168 files and directories currently installed.)
Unpacking libtcltk-ruby1.9.1 (from .../libtcltk-ruby1.9.1_1.9.2.0-1_amd64.deb) ...
Selecting previously deselected package ri1.9.1.
Unpacking ri1.9.1 (from .../ri1.9.1_1.9.2.0-1_all.deb) ...
Selecting previously deselected package ruby1.9.1-dev.
Unpacking ruby1.9.1-dev (from .../ruby1.9.1-dev_1.9.2.0-1_amd64.deb) ...
Selecting previously deselected package ruby1.9.1-examples.
Unpacking ruby1.9.1-examples (from .../ruby1.9.1-examples_1.9.2.0-1_all.deb) ...
Selecting previously deselected package libruby1.9.1-dbg.
Unpacking libruby1.9.1-dbg (from .../libruby1.9.1-dbg_1.9.2.0-1_amd64.deb) ...
Selecting previously deselected package ruby1.9.1-full.
Unpacking ruby1.9.1-full (from .../ruby1.9.1-full_1.9.2.0-1_all.deb) ...
Processing triggers for man-db ...
Setting up libtcltk-ruby1.9.1 (1.9.2.0-1) ...
Setting up ri1.9.1 (1.9.2.0-1) ...
Setting up ruby1.9.1-dev (1.9.2.0-1) ...
Setting up ruby1.9.1-examples (1.9.2.0-1) ...
Setting up libruby1.9.1-dbg (1.9.2.0-1) ...
Setting up ruby1.9.1-full (1.9.2.0-1) ...
railsapps@webby5973:~$ ruby1.9.1 -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
railsapps@webby5973:~$
====================================
Para desenvolvimento seguem alguns links legais.
Como instalar num Ubuntu(máquina de desenvolvimento):
http://www.rubyinside.com/how-to-install-ruby-1-9-2-and-rails-3-0-on-ubuntu-10-10-4148.html
Patchs para melhoria de performance (em dev, não melhora nada em produção) usando rvm com ruby1.9:
https://gist.github.com/1078666
Mais uma coisa. Não é que eu *não* recomendo 1.9, ok? Eu acho muito bom! Mas é que se for pra me dar mais trabalho para configurar o servidor e nenhum retorno (performance por exemplo) pra que eu vou fazer? Por isso que as apps do Heroku estão em 1.9. Não dá trabalho nenhum fazer isso no Heroku, mas em servidor própria a coisa muda.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment