对RUBY 几个版本的测试( performance test for severial rubys )

访问量: 1422

前几天看到这个文章: http://inosin.iteye.com/blog/1740633 以及robbin的微博,说道更换RUBY PATCH 之后带来的性能100%提升,我打算在自己的项目中实际测试一下。   不仅仅是跑 $rake routes, 我要跑遍所有的 test case, 这样更有代表性。  ( several days ago I saw a post mentioning that using RVM + falcon speed up 100% of ruby performance, so I want to have a try on my code, not only the "$rake routes", but also the "$rpsec spec" -- run all the test cases, so that I know how much benifits I can get in the real world. ) 

( gc var set: export RUBY_GC_MALLOC_LIMIT=60000000 export RUBY_FREE_MIN=200000 )

1.  Official Ruby 1.9.3:  (standalone version,  NOT rvm )

$ rake spec -I . :   ( ---- average time: 22.42 s  ) 
time ellapse: 22.185478835
time ellapse: 22.672805472
time ellapse: 22.449144903
time ellapse: 22.375249893
time ellapse: 22.42328384

with GC var set:
time ellapse: 19.656764126
time ellapse: 19.567634556
time ellapse: 19.731576858
time ellapse: 19.696367543
time ellapse: 19.699878242

$ rake routes:   ( average time:  4.10 s ) 
time ellapse: 4.073651412
time ellapse: 4.068737774
time ellapse: 4.095116022
time ellapse: 4.136936819
time ellapse: 4.119734137

with GC var set: 
time ellapse: 3.79018815
time ellapse: 3.862510267
time ellapse: 3.830122943
time ellapse: 2.972089698

2. RVM ruby 1.9.3

$ rake spec -I . :   ( ---- average time: 20.73 s , 7.5% up!  ) 
time ellapse: 20.850909014
time ellapse: 20.715897765
time ellapse: 20.605630532
time ellapse: 20.674324368
time ellapse: 20.830513131

with GC var set: 
time ellapse: 19.425704352
time ellapse: 19.201540791
time ellapse: 19.504168411
time ellapse: 19.210046565
time ellapse: 19.162727488

$ rake routes:   ( average time:  2.67 s , 65% up! ) 
time ellapse: 2.668698989    
time ellapse: 2.647600586
time ellapse: 2.666264516
time ellapse: 2.688923067
time ellapse: 2.661307934
with GC var set:    
time ellapse: 2.43559832
time ellapse: 2.442118418
time ellapse: 2.453796224
time ellapse: 2.463688373
time ellapse: 2.436229889

how to setup ruby with&without RVM: 

参考:http://inosin.iteye.com/blog/1740633

1. 安装 官方的ruby (非 RVM)
1. wget .... configure ... make ... make install

2. RVM ruby
2.1 install rvm
2.2 rvm requirement.... install...

2.3. Setup with RVM:

rvm get head
# open new shell
rvm reinstall 1.9.3 --patch falcon

订阅/RSS Feed

Subscribe

分类/category