I have a program that downloads a ~23MB file from a web server on the LAN using LWP. It runs nearly instantly on various UNIX flavors, but takes over 2 minutes on Windows using ActivePerl 5.8.8. I'm using LWP 5.808 on Linux and 5.814 on Windows, but I don't think the version difference is the issue.
Does anyone have any ideas about why this is so much slower on Windows?
Here's a test script and the output on both Windows and Linux:
Linux:
Downloaded succeeded
NAME TIME CUMULATIVE PERCENTAGE
Instantiate Useragent 0.000 0.000 0.002%
Download file 2.400 2.400 99.991%
_stop_ 0.000 2.400 0.007%
Windows:
Downloaded succeeded
NAME TIME CUMULATIVE PERCENTAGE
Instantiate Useragent 0.000 0.000 0.000%
Download file 133.377 133.377 99.988%
_stop_ 0.016 133.392 0.012%
use strict;
use warnings;
use LWP;
use Benchmark::Stopwatch;
my $url = 'http://hermes/datasquid/static.dbm';
my $stopwatch = Benchmark::Stopwatch->new->start;
my $ua = LWP::UserAgent->new;
$stopwatch->lap('Instantiate Useragent');
my $response = $ua->get( $url );
$stopwatch->lap('Download file');
if($response->is_success) {
print "Downloaded succeeded\n";
} else {
print "Download failed\n";
}
print $stopwatch->stop->summary;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.