h1

OpenWFEru on JRuby! Getting there …

September 21, 2007

Testing JRuby rev 4363 with OpenWFEru rev 1093 on OSX, with Java6 (1.6.0-dp). Ruby used was 1.8.6 (patch 0) which is known to have some threading problems.

All the jruby tests have -O -J-server options added. (Only those ones, compared to the vanilla jruby script)

1. Functional testing

jruby -Ilib:test test/ft_tests.rb

Finished in 63.312000000000005 seconds.
215 tests, 473 assertions, 0 failures, 0 errors

ruby -Ilib:test test/ft_tests.rb

Finished in 53.718509 seconds.
215 tests, 473 assertions, 0 failures, 0 errors

2. Quick in-memory testing

jruby -Ilib:test test/rake_qtest.rb

Finished in 75.07900000000001 seconds.
291 tests, 765 assertions, 1 failures, 0 errors

ruby -Ilib:test test/rake_qtest.rb

Finished in 64.828691 seconds.
291 tests, 770 assertions, 0 failures, 1 errors

3. Load testing

jruby -Ilib:test test/ft_26c_load.rb

Finished in 47.230000000000004 seconds.
1 tests, 1 assertions, 0 failures, 0 errors

ruby -Ilib:test test/ft_26c_load.rb

Finished in 21.641532 seconds.
1 tests, 1 assertions, 0 failures, 0 errors

4. Thread testing (experimental)

jruby -Ilib:test test/ft_26b_load.rb

(hanging) doesn’t end

ruby -Ilib:test test/ft_26b_load.rb

Finished in 3.658117 seconds.
1 tests, 1 assertions, 0 failures, 0 errors

5. Long tests (cron, scheduler and such)

jruby -Ilib:test test/rake_ltest.rb

Finished in 624.205 seconds.
45 tests, 89 assertions, 0 failures, 0 errors

ruby -Ilib:test test/rake_ltest.rb

Finished in 620.397724 seconds.
45 tests, 89 assertions, 1 failures, 0 errors

6. Conclusion

What this basically implies is that OpenWFEru on JRuby is almost there. Functional, Scheduling, and Engine testing all working fine. With about 99% test success.

The load test is a bit of a downside. Load performance of jruby is getting only half as fast, while it is almost on the par with cruby on the other test. But there has to be a way where this can be solved, and improved in the short term.

This is really cool. 2 months ago, the same tests results were completely different (deadlock, speed concerns…) Congratulations to both teams.

h1

Fixing a few bugs in JRUBY

July 23, 2007

I have been fixing the following in JRUBY today:
http://jira.codehaus.org/browse/JRUBY-1230
http://jira.codehaus.org/browse/JRUBY-1228
http://jira.codehaus.org/browse/JRUBY-1108

also, I have supplied patches for some others last week:
http://jira.codehaus.org/browse/JRUBY-1207
http://jira.codehaus.org/browse/JRUBY-1140
http://jira.codehaus.org/browse/JRUBY-1215
http://jira.codehaus.org/browse/JRUBY-1214

and the quite complicated on java threading:
http://jira.codehaus.org/browse/JRUBY-1157

I hope to be able to fix a few more in the next few days, while traveling to San Francisco.

My goal is to help John getting OpenWFEru to run at full speed on JRuby.
The OpenWFEru test suite has a few more quirks remaining, but it’s looking good.

Can’t wait to see this happening.

h1

Faster ruby(2)

July 20, 2007

Coming back to my previous post (and Charles’s comments!), I went and found my original test on those ruby constants.

picture-1.png

Here are the results on ruby (1.8.6):

  • WithConstants(N=5000000): 5.94s
  • WithoutConstants(N=5000000): 5.33s

Here are the results on jruby:

  • WithConstants(N=5000000): 34.15s
  • WithoutConstants(N=5000000): 27.47s

So my previous post was wrong, the same behavior appears on both ruby and jruby, and it looks like this is really worth the modification when running on jruby. Those are solely empiric results. I hope I can profile the jruby code and find the differences between the two tests and see from where comes the recorded time difference.

Updated:

Same tests again, with the options provided by Charles (-O -J-server -J-Djruby.jit.threshold=0):

  • WithConstants(N=5000000): 11.10s
  • WithoutConstants(N=5000000): 8.4s

Woah. That is really speeding things up!

h1

Faster ruby

July 20, 2007

After reading a post on symbols, I went on doing my own experiment. Here’s what came out:

h[:cool] = :hello

will execute approximately 2 times as fast as:

h["cool"] = :hello

The original post pointed out that symbols are never garbage collected but given the low memory footprint of Ruby, might as well get the extra speed.

An other experiment I did some time ago, if you declare:

module Niko MY_CONST = “this is a string for testing” end

and then try to access it:

Niko::MY_CONST

will be slightly slower than doing:

include Niko MY_CONST

Amusingly enough, this appears to be untrue on jruby. (confirmed that the same behavior is on both plateform, see next post)

h1

Textmate cheats

July 20, 2007

Might as well learn this one real fast. railstextmatecheats.pdf

h1

Tracing calls in ruby

July 19, 2007

This simple ruby method will trace every single call of the block given to the trace method.picture-2.png
For more complex things, the unroller gem can also be used.

h1

Switching between JVM on OSX

July 19, 2007

I wrote a little ruby script to switch the JVM on OSX. Nothing fancy, but this is saving quite some time when testing and debugging. 

 
pict.png