[ruby-core:91154] Testing MJIT on RHEL 7.5

From: Phil Edelbrock <edelbrp@...>
Date: 2019-01-18 01:34:09 UTC
List: ruby-core #91154
Hello, I'm new to this list.  I hope this is the right place to ask questions about the new experimental JIT implementation (which looks incredibly cool).

First, I've got both 2.6.0 installed and the latest from github (which I call 'edge') on RHEL 7.5:

[pedelbro@966629-app3 ~]$ /usr/local/ruby-2.6.0/bin/ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[pedelbro@966629-app3 ~]$ /usr/local/ruby-edge/bin/ruby -v
ruby 2.7.0dev (2019-01-16 trunk 66836) [x86_64-linux]

gcc:

Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) 

My /tmp is mounted (by default) as NOEXEC, so I created a regular directory in my home directory to get around the permissions error/warning:

MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p108878u0.so': /tmp/_ruby_mjit_p108878u0.so: failed to map segment from shared object: Operation not permitted

So, now things seem better:

MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is /home/pedelbro/my_tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -std=gnu99 -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -nodefaultlibs -nostdlib -o /home/pedelbro/my_tmp/_ruby_mjit_hp116911u0.h.gch /usr/local/ruby-edge/include/ruby-2.7.0/x86_64-linux/rb_mjit_min_header-2.7.0.h
start compilation: block in <main>@-e:1 -> /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -std=gnu99 -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.o /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.c -c -lgcc -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
Starting process: /usr/bin/gcc /usr/bin/gcc -std=gnu99 -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.so /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.o -lgcc -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
JIT success (37.9ms): block in <main>@-e:1 -> /home/pedelbro/my_tmp/_ruby_mjit_p116911u0.c

When testing, though, I only see slowdowns when turning on JIT?

This is a simple (and maybe a bad) example:

[pedelbro@966629-app3 models]$ time /usr/local/ruby-edge/bin/ruby --disable-gems --jit -e "5000000.times { 3 * 123 }"

real	0m0.229s
user	0m0.383s
sys	0m0.049s
[pedelbro@966629-app3 models]$ time /usr/local/ruby-edge/bin/ruby --disable-gems -e "5000000.times { 3 * 123 }"

real	0m0.208s
user	0m0.203s
sys	0m0.004s

Thanks!  Let me know if this is the wrong list to discuss this.  I hope to be another datapoint for testing, if it helps. :')


Phil

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next