D
Dave Sill
One of my users made the following observation. I'm only an
occasional, lightweight Perl user, so I can't explain what he's
seeing. Can anyone shed some light on it? H/W is a pretty large/fast
Dell server running RHEL 3.
----
I manufactured a 401x401 [ linearly =160801 element] array [@judy]
each element having string values like
01000000001110000000000000000001
I needed to make a comma delimited ascii file of this data.
I decided a single IO write of a string would be the fastest, so i
made a string
$str="";
foreach $i(0..$#judy-1)
{
$str=$str."$judy[$i],"
}
$str=$str."$judy[$#judy]"; open(OUT,">$output_file");print OUT
$str;close(OUT);
`gzip -f $output_file`;
this took 16 minutes.
i tried it the slow way,
open(OUT,">$output_file");
foreach $i(0..$#judy-1)
{
print OUT "$judy[$i],";
}
print OUT "$judy[$#judy]"; close(OUT);
`gzip -f $output_file`;
with 160K IOs, this took about 3 seconds.
the gz files were different, but diff said uncompressed they were the
same.
occasional, lightweight Perl user, so I can't explain what he's
seeing. Can anyone shed some light on it? H/W is a pretty large/fast
Dell server running RHEL 3.
----
I manufactured a 401x401 [ linearly =160801 element] array [@judy]
each element having string values like
01000000001110000000000000000001
I needed to make a comma delimited ascii file of this data.
I decided a single IO write of a string would be the fastest, so i
made a string
$str="";
foreach $i(0..$#judy-1)
{
$str=$str."$judy[$i],"
}
$str=$str."$judy[$#judy]"; open(OUT,">$output_file");print OUT
$str;close(OUT);
`gzip -f $output_file`;
this took 16 minutes.
i tried it the slow way,
open(OUT,">$output_file");
foreach $i(0..$#judy-1)
{
print OUT "$judy[$i],";
}
print OUT "$judy[$#judy]"; close(OUT);
`gzip -f $output_file`;
with 160K IOs, this took about 3 seconds.
the gz files were different, but diff said uncompressed they were the
same.