[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Poor performance of Ruby 1.8.7 when installed with MacPorts

arcadio

11/1/2008 10:59:00 AM

Hi,

I've just upgraded to Ruby 1.8.7 using MacPorts (ruby @1.8.7-
p72_1+thread_hooks) and while it runs flawlessly, the performance is
really really poor.

I'm talking in comparison with the Ruby distro that ships with
Leopard, and with my previous installation of 1.8.6 also done with
MacPorts.

For instance a bunch of rspecs i have take 6x to get executed, and ri
takes noticeably more time than previously to load any doc.

Is anyone experiencing the same problem? Do you know how to fix it?

Thanks in advance.
14 Answers

Brian Adkins

11/1/2008 4:47:00 PM

0

abc <arcadiorubiogarcia@gmail.com> writes:

> Hi,
>
> I've just upgraded to Ruby 1.8.7 using MacPorts (ruby @1.8.7-
> p72_1+thread_hooks) and while it runs flawlessly, the performance is
> really really poor.
>
> I'm talking in comparison with the Ruby distro that ships with
> Leopard, and with my previous installation of 1.8.6 also done with
> MacPorts.
>
> For instance a bunch of rspecs i have take 6x to get executed, and ri
> takes noticeably more time than previously to load any doc.
>
> Is anyone experiencing the same problem? Do you know how to fix it?

http://hivelogic.com/articles/2008/02/ruby-rai...

>
> Thanks in advance.

arcadio

11/2/2008 11:35:00 AM

0

Fine, thanks for the info.

Do you know what is the exact issue with MacPorts though?

nakatani katsumi

11/3/2008 10:02:00 AM

0

Hi

On Sat, 1 Nov 2008 19:58:54 +0900
abc <arcadiorubiogarcia@gmail.com> wrote:

> I've just upgraded to Ruby 1.8.7 using MacPorts (ruby @1.8.7-
> p72_1+thread_hooks) and while it runs flawlessly, the performance is
> really really poor.

> Is anyone experiencing the same problem? Do you know how to fix it?
The same problem reported at ruby-list-45593.(but Japanese only)

Summary is below.
1. On MacOS X(10.5.5), Ruby1.8.7(p72) compiled with --enable-pthread excute slowly,
as Ruby use time of 70% at rb_call()->getcontext() in fib.rb

2. In MacPorts, ./configure with --enable-pthread option makes config.h using getcontext
like below
#define HAVE_GETCONTEXT 1
#define HAVE_SETCONTEXT 1

3. If you comment out these two lines, you will get normal speed Ruby1.8.7.

4. As Ruby1.9 don't use getcontext()/setcontext(), Ruby1.9 don't care --enable-pthread.

arcadio

11/4/2008 1:23:00 PM

0

Thanks for the explanation!

arcadio

11/6/2008 6:30:00 PM

0

I filed a bug report and they've just fixed it:

http://trac.macports.org/ti...

Brian Adkins

11/7/2008 4:18:00 AM

0

abc <arcadiorubiogarcia@gmail.com> writes:

> I filed a bug report and they've just fixed it:
>
> http://trac.macports.org/ti...

Wow, that was fast. Is the Ruby community great, or what? :) Thanks
for reporting back with the info.

--
Brian Adkins
http://www....
http://lojic...

Nit Khair

11/7/2008 4:56:00 AM

0

nakatani katsumi wrote:
> Hi
>
> On Sat, 1 Nov 2008 19:58:54 +0900
> abc <arcadiorubiogarcia@gmail.com> wrote:
>
>> I've just upgraded to Ruby 1.8.7 using MacPorts (ruby @1.8.7-
>> p72_1+thread_hooks) and while it runs flawlessly, the performance is
>> really really poor.

Could someone explain this to to me. I checked the macports page a few
days back and it said it disables/deletes -enable-pthreads due to some
bug. So does that not mean that it's not there. As pointed above, it
uses thread_hooks instead.

1. Is there any commandline option or other way of my ascertaining
whether my install uses pthreads or not.

Another newb question:

2. One of the prev posts suggests altering config.h and running
/configure. However, if one is using sudo port install how does one do
this? I do not have a "configure" in my ruby folder and my config.h
(/opt/local/var/macports/software/ruby/1.8.7-p22_3+darwin_9_powerpc+thread_hooks/opt/local/lib/ruby/1.8/powerpc-darwin9.4.0/config.h)
does not contain GETCONTEXT.

Thanks.
--
Posted via http://www.ruby-....

Roger Pack

11/7/2008 9:36:00 PM

0

> Could someone explain this to to me. I checked the macports page a few
> days back and it said it disables/deletes -enable-pthreads due to some
> bug. So does that not mean that it's not there. As pointed above, it
> uses thread_hooks instead.

apparently somebody said that the most recent macport of it now compiles
with pthreads disabled.

>
> 1. Is there any commandline option or other way of my ascertaining
> whether my install uses pthreads or not.

from [1]
Maybe try with "ldd" on the ruby binaries--can't remember what the mac
equivalent is but it exists.


> Another newb question:
>
> 2. One of the prev posts suggests altering config.h and running
> ./configure. However, if one is using sudo port install how does one do
> this? I do not have a "configure" in my ruby folder and my config.h
> (/opt/local/var/macports/software/ruby/1.8.7-p22_3+darwin_9_powerpc+thread_hooks/opt/local/lib/ruby/1.8/powerpc-darwin9.4.0/config.h)
> does not contain GETCONTEXT.

If you install it from source you should be able to get at it
right...not sure using macports.

GL.
-=R

[1]
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a31872d447e867cb/40a92a...
--
Posted via http://www.ruby-....

Luc Heinrich

11/8/2008 8:54:00 AM

0

On 7 nov. 08, at 22:36, Roger Pack wrote:

> If you install it from source you should be able to get at it
> right...not sure using macports.

Using MacPorts, you just have to perform the various steps of the
'install' task manually, like this:

% sudo port fetch ruby
% sudo port extract ruby
% sudo port configure ruby

Now go in the work directory and change what you need. You can see
where that directory is by typing:
% port file ruby

After that, you can continue normally:
% sudo port install ruby

--
Luc Heinrich - luc@honk-honk.com


Nit Khair

11/8/2008 11:24:00 AM

0

Luc Heinrich wrote:
> On 7 nov. 08, at 22:36, Roger Pack wrote:
>
>> If you install it from source you should be able to get at it
>> right...not sure using macports.
>
> Using MacPorts, you just have to perform the various steps of the
> 'install' task manually, like this:
>
Thanks a lot.

btw, will installing 1.9 from macports create a separate executable such
as ruby1.9 so we can run 8 and 9 in parallel. Or overwrite?


Is there any way via macports to have both running in parallel.
Thanks.
--
Posted via http://www.ruby-....