rubinius/rubinius — Issue #1449: RBX is slower than JRuby on real-world threaded example
Author: chuckremes
Created: 2011-12-13 17:50:02+00:00
State: open

Code to repro: http://dl.dropbox.com/u/44434337/rbx_perf_issue.tgz

1. tar zxvf rbx_perf_issue.tgz

2. cd rbx_per_issue

# will ask for sudo permission to copy a C lib to /usr/local/lib. will also execute 'rbx -S gem install'
# on 3 gems in the directory. lastly, unpacks one gem for easy access to the repro script.
3. sh install_me

4. cd rzmq_brokers-0.7.0/test

5. rbx test_consensus.rb

This script creates a client, a broker, and 1 worker. It then has the client send 1_000 messages to the broker for the worker to consume and respond to. The round-trip time is captured and printed to the screen.

The script then *adds* 1 more worker and runs the test again.

As each client is added, you can see that the round-trip time increases (second column is milliseconds, 3rd column is elapsed seconds for 1_000 iterations). On my machine, the round-trip time increases approximately 900 microseconds for each additional client. Under JRuby, the rtt increases approximately 350 microseconds for each additional client.

RBX is about 2x slower. Right now the RBX profiler is broken for multi-threaded apps, but here's a flat and graph profile for this program as captured by JRuby. https://gist.github.com/1472608