Ruby Mail and benchmark.rb on CRuby, JRuby, IronRuby and RubyInstaller
by Željko Filipin
Update: Steve suggested I should try the script also with RubyInstaller, and I did it.
This blog post is update of my recent Ruby Mail on CRuby, JRuby and IronRuby post. Mikel and Jimmy have commented on the post saying I did a poor job, and I would agree. I decided to do a better job this time. Please let me know if measurements can be further improved.
So, I have an e-mail file called 1.eml
:
The First Try
This is the test from the first post. (RubyInstaller was not included in the first post.) It is included here so all code and numbers are at the same page, I guess it is easier to compare that way. Read the file, display subject and total time elapsed (in seconds).
Executed the script three times for each Ruby implementation. RubyInstaller the fastest, CRuby and JRuby were similar in speed, IronRuby was way slower.
Test Run | 1 | 2 | 3 |
---|---|---|---|
CRuby | 2.594 | 2.109 | 2.11 |
JRuby | 3.0 | 2.016 | 2.0 |
IronRuby | 9.8125 | 7.796875 | 7.6875 |
RubyInstaller | 1.21875 | 1.203125 | 1.203125 |
Test Run | 1 | 2 | 3 |
---|---|---|---|
CRuby | 0.015 | 0.016 | 0.0 |
JRuby | 0.047 | 0.047 | 0.047 |
IronRuby | 0.5 | 0.46875 | 0.484375 |
RubyInstaller | 0.0 | 0.0 | 0.0 |
Test Run | user | system | total | real |
---|---|---|---|---|
CRuby | 11.000000 | 0.657000 | 11.657000 | 13.485000 |
JRuby | 6.187000 | 0.000000 | 6.187000 | 6.187000 |
IronRuby | 69.984375 | 7.140625 | 77.125000 | 60.656250 |
RubyInstaller | 7.297000 | 0.766000 | 8.063000 | 9.953125 |
Environment
Tests were run in VMware Fusion 2.0.6 virtual machine, 512 MB RAM, Microsoft Windows Sever 2003 R2 (Standard Edition, Service pack 2).
Host machine is MacBook Pro, 2.4 GHz Intel Core 2 Duo, Mac OS X 10.6.2, 4 GB RAM.
Mail version 1.3.4 on all platforms. tags: code - ruby