ruby1.6 speed compared to 1.8 with/without threads

Discussion in 'Ruby' started by Martin Povolný, Sep 21, 2004.

  1. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hallo,

    while porting our software from ruby1.6 to ruby1.8, we found some
    performance issues.

    Especially it seems that compiling ruby1.8 with pthreads enabled
    (the way package is made in Debian GNU/Linux) gives poor results.

    I wonder if other people have noticed this?

    ==============================================================
    TEST: 1000.times { a = []; 4000.times {a << 1} }

    ruby1.8 without pthread: 6.679s
    ruby1.8 with pthread: 10.576s
    ruby1.6: 5.755s

    ==============================================================
    TEST: 1000.times { Array.new(3000).join ':' }

    ruby1.8 without pthread: 8.087s
    ruby1.8 with pthread: 10.503s
    ruby1.6: 7.810s

    ==============================================================
    TEST: 1000.times { s = ''; 2000.times {s << 'hello'} }

    ruby1.8 without pthread: 5.030s
    ruby1.8 with pthread: 6.807s
    ruby1.6: 7.099s

    ==============================================================
    TEST: 1000.times { def a; 'hello'; end; 2000.times { a } }

    ruby1.8 without pthread: 5.311s
    ruby1.8 with pthread: 8.386s
    ruby1.6: 4.116s

    ==============================================================
    TEST: 1000.times { h = {}; 1000.times {|t| h[t] = 'hello' } }

    ruby1.8 without pthread: 4.064s
    ruby1.8 with pthread: 6.436s
    ruby1.6: 3.461s

    ==============================================================
    TEST: 1000.times { 200.times {|t| eval('$test%d = \'hello\'' % t) } }

    ruby1.8 without pthread: 6.816s
    ruby1.8 with pthread: 8.507s
    ruby1.6: 5.630s

    ==============================================================
    TEST: 1000.times { ('X' * 100000).sub(/X/) {|s| s.downcase} }

    ruby1.8 without pthread: 7.843s
    ruby1.8 with pthread: 7.977s
    ruby1.6: 7.405s

    Regards,

    - --
    Martin Povolny

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)
    Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

    iD8DBQFBT+nADbrC2YihQUkRAjP2AJ96XSc8uwffThiJ5UqUehASrJh1nACfX/mV
    Bdekb8DystxQ00mIOm5Uw0g=
    =ztuy
    -----END PGP SIGNATURE-----
    Martin Povolný, Sep 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ham

    I need speed Mr .Net....speed

    Ham, Oct 28, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    2,318
    Antony Baula
    Oct 29, 2004
  2. threads without threads

    , Aug 27, 2004, in forum: C Programming
    Replies:
    4
    Views:
    384
    William Ahern
    Aug 27, 2004
  3. Voroztsov Artem
    Replies:
    0
    Views:
    182
    Voroztsov Artem
    Nov 24, 2007
  4. Iñaki Baz Castillo
    Replies:
    14
    Views:
    240
    Iñaki Baz Castillo
    Apr 5, 2009
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    632
    Rick DeNatale
    Dec 3, 2009
Loading...

Share This Page