Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Has anyone compared Cygwin Perl to AS Perl?

by ajt (Prior)
on May 16, 2002 at 08:45 UTC ( [id://166956]=perlquestion: print w/replies, xml ) Need Help??

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

For reasons of corporate policy I'm forced to have Windows NT as my desktop system. Thankfully I know have some *nix web servers, for production, but not yet as my "dev area".

For years I have used ActiveState Perl on my NT boxen, and it has worked fine, most of the time. Like others I have problems now and then, and I realy know how people feel when AS Perl goes belly up - For users of ActiveState Perl, this may someday save you some grief!, as it does now and then.

However as I don't have MS's Visual C, I am forced to download binaries via PPM after someone else has compiled them for me. If I can't find them, I can't use them.

There are several threds on the topic of PPM and it's repositories, and the truth is that there isn't a sigle CPAN style binary repositor yet for AS Perl - see CrazyPPM repository, interested? for example.

If the module doesn't require compilation, I can get it off CPAN, and using nmake I can install it most of the time without problems.

Over the years I've also grown to rely on the Cygwin "layer" on my NT box. It provides all those little tools that Microsoft forgot to include, like ssh, a decent shell, grep, gcc, etc. etc. Of late I've even got Cygwin/XFree86 up and running - most useful.

I've known that you can install Cygwin Perl on NT for some time, and even Apache, but never used it, as AS Perl is the default Perl on NT, it's what the books all talk about, and everyone assumes you have if you say "NT - Perl".

I'm also aware of both IndigoPerl and the SiePerl, but I already have Cygwin installed, and don't see any benefit from my perspective in these binary distributions over AS Perl.

I know that Cygwin is still officially beta code, and I know that the emulation layer does slow software down - Apache runs 30% slower apparently. Given a modern box, with plenty of RAM, that's not a prodcution server, I work mostly with CGI/HTML/XML and not Tk, my questions are:

  • What problems have people found with Cygwin Perl?
  • How fast is Cygwin Perl compared with AS Perl?
  • How much of CPAN works okay?
  • For people who have used both, which do you prefer, and why?
  • What functionality does AS Perl have that Cygwin Perl does not?

As ever, humble thanks in advance.

Replies are listed 'Best First'.
Re: Has anyone compared Cygwin Perl to AS Perl?
by broquaint (Abbot) on May 16, 2002 at 09:52 UTC
    * What problems have people found with Cygwin Perl?
    I've been using Cygwin Perl for several months and the only problem that springs to mind is that occasionally when I'm makeing a module Win98 locks up for a few seconds (which subsequently convinces my modem it's no longer connected throwing me off the net).
    * How fast is Cygwin Perl compared with AS Perl?
    I've not noticed any appreciable difference, but I haven't been running in time critical or large-scale applications with it either, so I couldn't say with any certainty.
    * How much of CPAN works okay?
    I'd say around 95% works a charm, and the other 5% is just a little fiddly. The only problems I've had are with the XML::Parser suite, but that's mainly because I couldn't setup up expat properly, so nothing to worry about there either.
    * For people who have used both, which do you prefer, and why?
    I definitely prefer Cygwin. Why? CPAN CPAN CPAN. I'd always had 'issues' with CPAN on AS, but it couldn't be easier on Cygwin (well maybe if you were using CPANPLUS ;-) Although AS does have a really nice setup and it's got lots of pretty HTML docs, so it's nicer from a users view.
    * What functionality does AS Perl have that Cygwin Perl does not?
    It integrates with Windows very nicely with it's filetype associations, PerlScript, comprehensive docs and other various niceties. I'd say if you want to develop perl apps for Windows then AS will definitely be the easier route of the two.
    HTH

    _________
    broquaint

(RhetTbull) Re: Has anyone compared Cygwin Perl to AS Perl?
by RhetTbull (Curate) on May 16, 2002 at 12:12 UTC
    broquaint provided some good answers but since I also use cygwin every day, I'll add some input as well.
    What problems have people found with Cygwin Perl?
    Very few problems -- it works very well. The only problem I found was an obscure bug that showed up in cygwin perl 5.6.1 but not any other perl I tried. It had to do with $^S getting set incorrectly after an eval block. I filed a bug report and was told that this would be fixed in perl 5.8. Other than that, I've had no problems.
    How fast is Cygwin Perl compared with AS Perl?
    I do process some very large (several hundred MB+) files and I do see a noticeable slowdown on cygwin apps (this affects all cygwin apps, not just perl). It can be as much as 40% slowdown but usually is closer to 10-20%. If you have a fast machine and aren't doing any really huge processing, you probably won't even notice. Because cygwin adds a layer between your application and the OS, there is some overhead due to translating calls from unix to windows and vice versa.
    How much of CPAN works okay?
    I've had pretty good luck with almost everything. As broquaint also mentioned, I was not able to get some of the XML stuff working. After a fair amount of fiddling, I did get enough functionality in place to let me work. That was quite a while ago so I don't know what's changed since then and I don't recall what I had to fiddle with. Since cygwin comes with a good C compiler, it can easily compile and install most CPAN modules.
    For people who have used both, which do you prefer, and why?
    I prefer the cygwin perl. Mainly because I spend most of my time in a cygwin shell so it's handy to use a perl that also thinks it's in unix (and understands cygwin paths, etc.) Also, as broquaint mentioned, cpan! -- it's really nice to be able to use cpan to install modules and not have to rely on someone building a PPM file.
    What functionality does AS Perl have that Cygwin Perl does not?
    The only thing that I can think of is that you need AS to use any windows specific (e.g. Win32:: ) modules. For example, I use AS a lot to use the Win32::OLE module. To make it easier to integrate AS and cygwin, I created an alias in my bash shell called "winperl" that points to AS perl. That way I can call AS perl easily from cygwin. I also put this into my shebang line on scripts that need AS perl: "#!/cygdrive/c/Perl/bin/perl.exe -w" that way they are executed transparently by cygwin.
      Hi RhetTbull? I am new to perling. I am using Active perl to do some excel related stuff later it does some make under cygwin. I am calling cygwin, from a batch file from the actual perl script. I could do everything under Cygwin itself, since win32 modules are not seen to cygwin, I had to do all this. Now, I want it to be working under cygwin, using transparency you are speaking about , could you please let me know, If I can proceed. I am sure, My question is not properly conveyed. Please let me know, just if we can use win32 modules from cygwin, using the transparency you were speakign about with only Active perl installed in my computer?
Re: Has anyone compared Cygwin Perl to AS Perl?
by shelob101 (Sexton) on May 16, 2002 at 12:45 UTC
    I must admit that I don't have too much to add to the informative answers already supplied, but I do have some experience with Apache CGI that leans a bit toward AS.

    I develop under the Apache for Win32, which does not/cannot be told about the Cygwin environment. CGI scripts that are written for this server have an easier time if written in AS, there's less mucking about with filenames and paths than the cygwin distro.

    Offsetting that is the ease of implementing modules under cygwin/CPAN. Sometimes I'd like to create a snazzy CGI app that uses some module that may not be compiled as a PPM yet (Image::Magick comes to mind, but it's a PPM now). Under those circumstances I usually punt and wait till I'm near one of my linux boxes.

    Anyone here played with cygwin cgi scripts under Win32 Apache?


    Overall, I believe your problem is a good one - Which of two fine perl implementations to use!


    Good Luck

Re: Has anyone compared Cygwin Perl to AS Perl?
by ignatz (Vicar) on May 16, 2002 at 13:33 UTC
    I use both alot and I do notice a bad slowdown/machine lock using Cygwin when it hits big scripts. It's bad enough for me to stick to ActiveState for most of what I do. I'd be curious to see how it works on a machine with dual processors.
    ()-()
     \"/
      `                                                     
    
Re: Has anyone compared Cygwin Perl to AS Perl?
by perrin (Chancellor) on May 16, 2002 at 16:23 UTC
    I have both running on my Win2K box. I stopped using the Cygwin version because the AS one has two major advantages: pre-compiled DBD::Oracle from the PPM repository, and correct handling of path names. Cygwin Perl does crazy things to path names sometimes, and doesn't handle the whole \ problem on Windows as well as AS does.
Re: Has anyone compared Cygwin Perl to AS Perl?
by thunders (Priest) on May 16, 2002 at 20:34 UTC
    I use both pretty extensively. If I want to make use of any of the various cygwin tools I use cygwin perl. AS perl's new cpanplus module is about as reliable as cygwins cpan(which is to say so-so) Plus AS has the awesome ppm utility. Straight out makes/nmakes go fairly well with either tool.
    Generally I go with Active state, because it works well with my whole remote server/Database package(Apache/Mysql/PHP) plus it has a few neat modules that don't translate to cygwin. The Win32::* series is one that I use often at work. Spreadsheet::WriteExcel is another.
    Another annoyance with Cygwin as mentioned by perrin is backslashitis you'd need to type \\\\\\\\ to make a system call to a remote computer.
Re: Has anyone compared Cygwin Perl to AS Perl?
by rinceWind (Monsignor) on May 17, 2002 at 08:25 UTC
    Excellent node: ajt++

    This is very timely for me, as I have been using ActiveState Perl for hobby projects at home. This was brilliant in the beginning, and I was able to get started very quickly and extend Perl with PPM.

    However, I'm writing much more of my own stuff now, and I have the C++ compiler, and I am running into trouble when I try and build modules under AS. The CPAN and CPANPLUS autoinstaller b0rks in a quite inconsistent way.

    To fix this I have installed the cygwin shell, but ASPerl still uses Ms-dos to run commands.

    I might have a go at building Perl from scratch using Cygwin. Is this recommended or should I just download the binary? Ideally I would prefer to play with building my own, as I could also have bleadperl available alongside.

Re: Has anyone compared Cygwin Perl to AS Perl?
by Sweeper (Pilgrim) on May 17, 2002 at 05:40 UTC
    For reasons of corporate policy I'm forced to have Windows NT as my desktop system.
    Me too!

    Until recently, I was using Indigo Perl. But I have upgraded my Cygwin installation, and then compiled Perl 5.6.1.
    There was one major problem with Indigo Perl: I could not compile XS modules. Yet, I must admit that I have not tried to compile XS modules under Cygwin yet.
    As for Active Perl, I did not try it because installation requires that you be connected to the web, and I know that where I work, HTTP requests are logged and quota are computed... :-(

Re: Has anyone compared Cygwin Perl to AS Perl?
by dada (Chaplain) on May 20, 2002 at 13:18 UTC
    * How fast is Cygwin Perl compared with AS Perl?

    well, you can find an extensive comparison here: AS Perl and Cygwin Perl.

    Cygperl is overall 26% slower and uses 18% more memory, but there are some noticeable points:

    • Cygperl does have an enormous startup cost compared to AS Perl (cfr. hello)
    • Cygperl seems to be faster when there's STDIN input to process (cfr. moments, spellcheck, sumcol, wc).
    • on the echo test, which involves fork and sockets, Cygperl took 100 seconds with 10000 connections, while AS Perl took less than 2 seconds!
    • if we exclude hello and strcat (for which there's a difference of only 0.09 seconds, but which makes more than 100% slower), Cygperl is 0.94% faster than AS Perl.
    cheers,
    Aldo
    __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;
Re: Has anyone compared Cygwin Perl to AS Perl?
by jlf (Scribe) on May 17, 2002 at 19:15 UTC
    For those who don't know already, using ActivePerl under Cygwin is fairly straightforward as described here.

    Josh

automating install: Re: Has anyone compared Cygwin Perl to AS Perl?
by tphyahoo (Vicar) on Feb 08, 2007 at 10:33 UTC
    slightly OT, but you can automate the cygwin install somewhat using setup.ini:

    http://www.cygwin.com/ml/cygwin/2006-05/msg00745.html

    I'm currently trying to use this to get my "cygwin for perl" installation process a bit more sane.

    Thanks to corion for pointing this out.

    ******

    UPDATE: On second thought, setting up a local repository sounds like too much work for just the occasional install.

    I'm just keeping my notes on what's needed for building with cpan in a local bash alias.

    $ thartman_cygwin_install_hint install under c:/, not the default install under devel make gcc cvs svn ssh under editors emacs everything under perl mkdir /home/hartman and svn co shellenv under there. in windows env vars (right click my computer, properties, advanced) set HOME to /home/hartman add c:\bin;c:\usr\local\bin; to front of PATH (make sure it's ahea +d of c:\windows\system32) if necessary, reinitialize cpan cpan> o conf init

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found