SPUG: print statement taking ridiculously long

Fred Morris m3047 at m3047.net
Tue Jul 23 10:19:19 PDT 2013


We've got a script. It produces a huge string after much thrashing:

  $big_string = "60 Megs or so";

Then it tries to write it to a file:

  open OUT, ">$file";
  print OUT $big_string;
  close OUT;

Well that print statement takes over half an hour with one core running at 
100% CPU! For that matter we've discovered that taking the  length of 
$big_string takes an inordinate amount of time as well. The job doesn't 
appear to be swapping.

This is happening on the Debian build of perl 5.14. It runs (the whole script) 
in 5 minutes or so on other (older) versions of perl on far more modest 
hardware.

Thoughts?


(BTW, anybody interested in some sort of perl party/meetup in Tacoma?)

--

Fred Morris



More information about the spug-list mailing list