The C extension runs like a dog under Rubinius; here's a patch to improve per by 10 (yes 10) orders of magnitude

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.0.9
    • Affects Version/s: 1.0.8
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      http://gist.github.com/581704

      Two major changes.

      1. The fast_pack function now lives up to its name. Instead of constantly cat'ing data and reallocating buffers, the buffer is allocated once and data is safely copied in. A string is created once at the very end.

      2. All uses of RARRAY_PTR were replaced with calls to rb_ary_entry(). This C API function is present on 1.8.7, 1.9.x and Rubinius. Using this instead of RARRAY_PTR prevents a lot of cache copying and flushing for Rubinius.

      Performance under MRI was slightly improved when tested with bin/standard_benchmark. Improvement was approximately 5% for serializing/deserializing LARGE objects.

            Assignee:
            Kyle Banker (Inactive)
            Reporter:
            Chuck Remes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: