JRuby at OpenFeint - a JRuby migration success story

    14 Nov 2012

    TL;DR: OpenFeint gets 40% performance improvement after migrating to JRuby from REE.

    About OpenFeint

    OpenFeint was the largest mobile social gaming platform in the world, It was acquired by GREE for $104 million last year, and a new global platform is building to replace OpenFeint. It is still one of the biggest rails applications, with hundreds of thousands API calls per minute.

    OpenFeint platform is using rails 2.3.14 and was running on ree 1.8.7.

    Why try JRuby

    My main job is to improve the performance and scalability of OpenFeint platform. This April, I attended Railsc...

    Read More


    how to write a jruby gem - part 2

    23 Aug 2012

    In my previous post, I introduced how to write a jruby gem with ruby code, today I will show you how to write a jruby extension with java code, which can give you better performance.

    Standard Steps

    1. create java classes to wrap any java library you need, and the java classes must extend RubyObject, then it can be called from jruby. e.g.

    class Memcached extends RubyObject {
        // MemcachedClient is what we want to wrap
        private MemcachedClient client;
        // java constructor
        public Memcached...
    Read More


    jruby-memcached 0.5.0 released

    22 Aug 2012

    I just released jruby-memcached 0.5.0, it contains the following changes:

    1. add travis-ci support, testing jruby-18mode, jruby-19mode and jruby-head environment.
    2. update spymemcached to 2.8.3, which set shouldOptimize to false by default, there are some bugs with true shouldOptimize so far.
    3. fix increment/decrement issue, in < 0.5.0, incr/decr with unmarshal encode while get with marshal decode.
    4. accept exception_retry_limit option.
    5. add Memcached::ATimeoutOccurred error to handl...
    Read More


    jruby-memcached 0.4.0 released

    17 Aug 2012

    I just released jruby-memcached 0.4.0, it contains the following changes:

    1. run spymemcached as a daemon thread. I found when running rake task with jruby-memcached < 0.4.0, it won't stop unless you press Ctrl+C.
    2. get method can accept multiple keys.
    3. add Memcached::Rails as a rails cache_store. Of course, it is compatible with Memcached::Rails in memcached.gem.
    4. make full use of jruby annotation to reduce method definitions with optional and rest arguments.

    check out the full code changes here.

    ... Read More


    jruby-memcached 0.3.0 released

    07 Aug 2012

    I just released jruby-memcached 0.3.0, it runs about 10%-20% faster than 0.2.0, I removed ruby code and totally wrote it by java code, check out the file changes.

    2 weeks ago, I released jruby-memcached 0.1.0, in that post I mentioned jruby-memcached response time in a request is 40+ms while memcached.gem response time is 30+ms, it looked fine, but I was still investigating the way to improve jruby-memcached performance.

    After reading jruby-spymemcached gem and jruby source code, I rewrote jruby-memcached by pure java code instead of ruby code, because calling java f...

    Read More


    how to write a jruby gem - part 1

    06 Aug 2012

    In my previous post, I mentioned I have written a jruby memcached gem. I'm glad to share my experience how to extend jruby here.

    JRuby is a 100% java implementation of ruby programming language, it allows you calling java code from ruby code. Java world has much more libraries than ruby gems, to make use of those java jar, it makes your code easier and faster.

    I assume you already had the exper...

    Read More


    jruby-memcached 0.1.0 released

    24 Jul 2012

    I just released jruby-memcached 0.1.0 gem, which is the fastest jruby memcached client so far and it is also compatible with memcached.gem. The following is the story why I created jruby-memcached gem.

    We are trying to migrate our service from ree to jruby. It's a big project for us, as our repository is written from early 2009, it becomes bigger and bigger, and nobody can promise migrating it to jruby without any ...

    Read More