Some new numbers.
SUMMARY
In Petstore script/benchmark_action:
* trunk runs two times faster than 1.0.1
* there seems to be a significant bottleneck somewhere in executing
the Rails framework
* when framework processing is excluded, JRuby is about 1.5 times
slower than MRI
* Unlike earlier test runs, AR-JDBC in the current trunk has a
noticeable advantage over pure-Ruby MySQL driver
DETAILS
Ola and yours truly are on the next iteration of JRuby performance
tuning for Rails. I wrote a couple of scripts to drill down into
various parts of Rails, to decide where to focus.
The scripts, essentially, measure the average roundtrip time of
app.get('url'), controller.send(action) and controller.render(), by
1000 iterations of each block, 10 runs.
JRuby JIT compiler is warmed up by 10000 iterations of each test prior
to measurements. The numbers reported below are from the 10th run.
Variation between last 5 runs in all of these tests is under 5%, so
it's doesn't really matter that it's not an average.
Note that there is no web server, and no session handling involved in
these tests.
Also, note that the relative amount of database / model work involved
in CategoriesController#show is rather small.
Here are the numbers:
Runtime MRI Jruby Jruby 1.0.1
DB driver native pure Ruby AR-JDBC pure Ruby AR-JDBC
Controller 1.1 2.0 1.7 2.5 7.19
View 4.5 4.4 6.7 6.6 17.08
Framework 2.7 3.5 9.3 9.5 11.8
Full action 8.3 9.9 17.7 18.6 36.03
JRuby 1.0.1 / AR-JDBC:
controller : 1.867000 0.000000 1.867000 ( 1.867000)
TEST SETUP AND PROCEDURE
Hardware: Dell D620
OS: Ubuntu 7.04
Kernel: 2.6.20-16-generic #2 SMP Fri Aug 31 00:55:27 UTC 2007 i686
GNU/Linux, default from the distro.
Ruby: ruby 1.8.5 (2007-03-13 patchlevel 35) [i686-linux]
JRuby: trunk rev 4384
Database: MySQL 5.0.38 (binary from the distro)
Application: Petstore from
http://tw-commons.rubyforge.org/svn/petstore/trunk/ (rev 177).
Measuring:
Ruby: echo 'load "script/benchmark_action"' | ruby script/console production
JRuby: echo 'load "script/benchmark_action"' | jruby
-J-Djruby.objectspace.enabled=false script/console production
# replace production with ar_jdbc for running with AR:JDBC driver
--
Alexey Verkhovsky
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email