From: Jeffrey 'jf' Lim Date: 2007-09-05T12:38:41+09:00 Subject: Re: Ruby is much slower on linux when compiled with --enable-pthread? On 9/4/07, Adam Kramer wrote: > Hi, > > I was seeing significant performance differences between ruby 1.8.4 on > an old distribution and a newer one. I spent some hours ... > I would be curious about this - are you talking about between ubuntu 6.06, and a newer version of ubuntu? > > It appears that when compiled with --enable-pthread ruby will call > sigprocmask MANY MANY more times than without. You can verify this > with strace -c: > $ strace -c ruby -e '1.upto(100000) {|i| i.to_s}' > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.000655 0 200006 sigprocmask > > Yeah - it called sigprocmask over 200,000 times during that 100,000 > iteration loop. > same here - ubuntu 7.04 64-bit, ruby 1.8.6 - % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 0.002105 0 200009 rt_sigprocmask I also see some errors (8, 3, and 7 respectively - and consistently) on 'open', 'stat', and 'access'. Do you see those as well? > When compiled with --disable-pthread and running the same command, > rt_sigprocmask gets called 4 times. > :) for me, this is 2 times. > I also tested on OS X, ruby is compiled with --enable-pthread but > sigprocmask doesn't get called an inordinate number of times, so this > may be a linux-only issue. > hmm.. what would be the equivalent of 'strace' here? -jf -- In the meantime, here is your PSA: "It's so hard to write a graphics driver that open-sourcing it would not help." -- Andrew Fear, Software Product Manager, NVIDIA Corporation http://kerneltrap.org/node/7228