Your skill will accomplish
what the force of many cannot
?? Blazes under Linux; crawls under XP & Win2K...by WordWeaver (Acolyte)
|on Jan 09, 2006 at 08:40 UTC||Need Help??|
WordWeaver has asked for the
wisdom of the Perl Monks concerning the following question:
I'm trying to figure out why a script that I've written runs in half a minute under Linux, but takes a half-hour or more under Win32.
The script loops through a text file containing ~800K variable-length, pipe-delimited records. The first byte of each line identifies record type.
The script copies each line of the source file to one of several destination files, depending on that line's record type ID.
In a Linux environment,the script processes the text file in ~30 seconds. I've tried the identical script under XP Home and Win2K. In both environments, running ActivePerl, the same script takes 30 - 40 minutes. The XP install is on a dual-boot machine with the Linux environment. I tried running the script under Cygwin on the dual-boot machine, but it didn't run any faster.
The obvious solution, for me, is to run the script only under Linux. But it could be useful to colleagues who only have Win32.
I'd be grateful for any tips on writing something that runs faster under Win32.
The script contains similar if statements for each record type.
Edit: g0n - replaced pre tags with code tags