Ruby Script Under performance in CYGWIN environment

A

ankit

Hi,

I have written one ruby script to execute the regression testcases.
There are more than five thousand of testcases to be run daily.

For Linux, the performance was ok and on expected line but on CYGWIN
shell, the script is taking a lot more time ( I would say almost
double of time) in running the same testcases as compared to similar
script written in perl.

Is ruby under performance is related and specific to cygwin shell or
is ruby not meant at all to be run on windows and this is known
performance issue?

I am using the following : CYGWIN_NT-5.1 and ruby 1.8.4

regards,
Ankit
 
M

M. Edward (Ed) Borasky

ankit said:
Hi,

I have written one ruby script to execute the regression testcases.
There are more than five thousand of testcases to be run daily.

For Linux, the performance was ok and on expected line but on CYGWIN
shell, the script is taking a lot more time ( I would say almost
double of time) in running the same testcases as compared to similar
script written in perl.

Is ruby under performance is related and specific to cygwin shell or
is ruby not meant at all to be run on windows and this is known
performance issue?

I am using the following : CYGWIN_NT-5.1 and ruby 1.8.4

regards,
Ankit

Download the Ruby source (1.8.6) and recompile it on Cygwin using the
following CFLAGS

export CFLAGS='-O3 -march=<your processor type goes here>'

For example, if you're running a Pentium 4, do

export CFLAGS='-O3 -march=pentium4'

That will give you at least a 10 percent improvement over the base Ruby
1.8.4 you have now.
 
R

Robert Klemme

What do these test cases do? Is there any IO involved other than
reading the code? What else is going on on that box? Is it similar
hardware? ...

Of course it is meant to be run on Windows - otherwise there would be no
point in having a cygwin package, would it? I am running my Ruby
scripts on cygwin for quite some time now and do not encounter any issues.

Since you are giving no hard facts its difficult to answer. I tend to
believe that the cygwin version might be slower but haven't measured
myself and certainly would not expect a factor of two on the same
hardware. /Did/ you test on the same hardware?

First of all I would to some measurements to have hard facts. Maybe a
simple command line loop like

Robert@Babelfish2 ~
$ ruby -e 't=Time.now;5_000_000.times {};p(Time.now-t)'
2.031

Download the Ruby source (1.8.6) and recompile it on Cygwin using the
following CFLAGS

export CFLAGS='-O3 -march=<your processor type goes here>'

For example, if you're running a Pentium 4, do

export CFLAGS='-O3 -march=pentium4'

That will give you at least a 10 percent improvement over the base Ruby
1.8.4 you have now.

I doubt that the OP will be satisfied with a 10% improvement. Btw, the
current version is not 1.8.4:

Robert@Babelfish2 ~
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]

Robert@Babelfish2 ~
$ uname -a
CYGWIN_NT-5.1 Babelfish2 1.5.25(0.156/4/2) 2007-12-14 19:21 i686 Cygwin


Kind regards

robert
 
M

M. Edward (Ed) Borasky

Robert said:
I doubt that the OP will be satisfied with a 10% improvement. Btw, the
current version is not 1.8.4:

Robert@Babelfish2 ~
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]

I suspected that but didn't have my Cygwin system handy. The operative
factor here is that "i386". I have no idea what compiler the Cygwin
people used to build that Ruby or what optimization flags they used, but
I do know that i386 is the lowest common denominator. That is
unfortunately also the case for RHEL, Debian and Ubuntu, and probably
also the case for Fedora. I think the One-Click installer has more
optimization.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top