Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Cygwin Perl vs. ActivePerl

by jdhedden (Deacon)
on Sep 02, 2005 at 15:57 UTC ( [id://488692]=perlquestion: print w/replies, xml ) Need Help??

jdhedden has asked for the wisdom of the Perl Monks concerning the following question:

I recently did a speed comparison of my module Math::Random::MT::Auto under Cygwin Perl and ActivePerl. To my surprise, ActivePerl was more than twice as fast as Cygwin Perl. In fact, for the built-in rand function, it was more than 4 times faster!

Has anyone else encountered this phenomenon? Is it the result of the underlying Cygwin architecture, or does it have something to do with the way ActivePerl is compiled under Windows?

My guess is that Cygwin is the culprit. But does anyone have any definitive information on this?


Remember: There's always one more bug.

Replies are listed 'Best First'.
Re: Cygwin Perl vs. ActivePerl
by puploki (Hermit) on Sep 02, 2005 at 17:36 UTC

    I have two thoughts on this - one, Cygwin is an emulation layer is is trying to emulate *NIX on Windows. With any kind of emulation/virtualisation you're going to get a performance hit.

    Secondly, I think ActivePerl is built with Visual Studio and all the "regular" MS provided compilers. I imagine these are all well placed to take advantage of all the quirks of the Windows API and get the best performance.

Re: Cygwin Perl vs. ActivePerl
by rvosa (Curate) on Sep 02, 2005 at 19:22 UTC
    I've noticed the same: ActiveState is faster than Cygwin perl. I've always ascribed this to the layer thing.
Re: Cygwin Perl vs. ActivePerl
by jdhedden (Deacon) on Sep 02, 2005 at 20:44 UTC
    After assimilating what little info I could glean off the web, my conclusion it that Cygwin is the issue. The cygwin.dll provides Unix emulation for all system calls, including such things as malloc(). These, in turn, interact with the Windows environment.

    ActivePerl doesn't have to go through a middle-man, and can interact with Windows directly.

    However, will all the other features I get with Cygwin, I'm not inclined to trade it in for straight Windows/DOS. If I'm ever in need of extreme speed for Perl on a Windows box, then I might consider a parallel installation of ActivePerl for just that task.


    Remember: There's always one more bug.
Re: Cygwin Perl vs. ActivePerl
by Roger (Parson) on Sep 03, 2005 at 15:28 UTC
    ActivePerl was compiled with Visual C++, which produces the fastest executable out of all its competitors, which is also one factor worth considering.

      In the context of this test of MSVC vs Cygwin, sure, MSVC is faster. However, in the context of "all its competitors", Intel still holds that title. We use the Intel compilers on Windows/ia32 and Linux/ia32 for our product just for that boost in speed. It's not as dramatic, but in our business, performance is a marketing mantra, so we'll take every little bit we can get.

      Intel promises a minimum of 4% speed boost. Of course, I'm not entirely sure what that really means - then again, I'm just a techie, not a marketing guru.

        In compiler technology nowadays, it's really to do with how clever you can arrange your code to take advantage of the CPU caching, super scalar pipelining, etc. I actually believe Intel will have a 4% speed boost because of 'undocumented features'. :-D

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://488692]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found