Ruby Script Under performance in CYGWIN environment

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

On 28.01.2008 05:02, M. Edward (Ed) Borasky wrote:

ankit wrote:

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

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? …

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?

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.

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

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

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

ankit wrote:

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=’

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.

Robert K. wrote:

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.