Hide Forgot
Description of problem: It is well known enable-pthread option is causing slowness in Ruby 1.8.7. In Ruby enterprise edition, it uses disable-pthread, and in ruby version rolled out by puppet for puppet enterprise 2.0 for RHEL6, it also uses disable-pthread. In Ubuntu/Oneiric 11.10, this issue is resolved, it uses "ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]". In RHEL6U2 (ruby-1.8.7.352-3.el6.x86_64) and Fedora 16 (ruby-1.8.7.352-3.el6.x86_64), the enable-pthread is still in place, causing slowness. Upstream bug: http://bugs.ruby-lang.org/issues/2553 Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+bug/307462 Version-Release number of selected component (if applicable): How reproducible: See upstream bug to patch and set to disable-pthread time ./ruby -e '1_000_000.times { x = 2 ** 256 }' Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Customers deployments will depend on puppet/ruby any performance gain would be beneficial right now customer is having to maintain their own ruby install.
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux.
I tried to do some tests, and I haven't found any issues regarding binary incompatibility with the provided patch[1, 2] using ABI compliance checker tool[3] on x86-64, i386, ppc and ppc64 regarding the Ruby *.so lib. I can confirm the performance boost around 30% with the simple test mentioned in upstream bug. Regarding the reopening the issue in upstream because of the binary incompatibility[4] it's said that this affected rabbit and mikutter installed with pkgsrc on NetBSD 5.1 (i386) which needed to be rebuilt probably because of the patched Ruby's config.h missed these 3 lines: #define HAVE_UCONTEXT_H 1 #define HAVE_GETCONTEXT 1 #define HAVE_SETCONTEXT 1 I confirmed that with Takahiro Kambe who mentioned that in Japanese. In our case (RHEL/i386) it obviously miss these two: #define HAVE_GETCONTEXT 1 #define HAVE_SETCONTEXT 1 (#define HAVE_UCONTEXT_H 1 is there) So to say Ruby will use _longjmp()/_setjmp() instead of getcontext()/setcontext() which is actually what the patch does in the first place[2]. How big this can be an issue for us I am not sure. If somebody knows how this could affect something in our distribution, please say so. [1] http://timetobleed.com/fix-a-bug-in-rubys-configurein-and-get-a-30-performance-boost/ [2] https://github.com/ice799/matzruby/commit/0b9b69f9653782a33aee2b8937d405eae245b60c [3] http://ispras.linuxbase.org/index.php/ABI_compliance_checker [4] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/43152
Josef, Per Vit email conversation... "Disabling pthreads resolves the slowness issue but introduces binary incompatibility. Because of RHEL's KABI/ABI restrictions this is not applicable to RHEL. If you disable pthreads, you cannot build tcl/tk bindings anymore. So at present time there is no available solution"