E
enjoylife_95135
So my little Perl program is reading a giant chunk of data from a MySql
DB, processing it, and then writing it out to STDOUT.
I have the Mysql DB read down, thanks to earlier help from the kind
folks here. I don't believe I can speed up the memory processing, it
takes about 2.5 mins right now to process about 2M entries, and given
the nature of what I'm doing I can't ask for anything better.
But writing to STDOUT is slow, and worse, there is a lot of variation
depending on when I run it. So run1 took 2m, while run 5 took 5m 8s.
I ran Devel:Prof, which informed me that the offending line is a
printf() statement. I read elsewhere on google that printf's tend to be
slow because of the overhead added by formatting.
Wondering if there were some tricks I could use to speed things up?
The line currently looks like:
printf "%10d %10d %20s %20s %5d %s\n",
$f,$pin,$str1,$str2,$filesize,$tstring;
Thanks everyone.
EL
DB, processing it, and then writing it out to STDOUT.
I have the Mysql DB read down, thanks to earlier help from the kind
folks here. I don't believe I can speed up the memory processing, it
takes about 2.5 mins right now to process about 2M entries, and given
the nature of what I'm doing I can't ask for anything better.
But writing to STDOUT is slow, and worse, there is a lot of variation
depending on when I run it. So run1 took 2m, while run 5 took 5m 8s.
I ran Devel:Prof, which informed me that the offending line is a
printf() statement. I read elsewhere on google that printf's tend to be
slow because of the overhead added by formatting.
Wondering if there were some tricks I could use to speed things up?
The line currently looks like:
printf "%10d %10d %20s %20s %5d %s\n",
$f,$pin,$str1,$str2,$filesize,$tstring;
Thanks everyone.
EL