http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5389





------- Additional Comments From [EMAIL PROTECTED]  2007-03-25 18:22 -------
Sorry for nitpicking below, this comment is unrelated to the topic,
I was just curious and made a trivial benchmark (time, VSZ),
feel free to ignore this comment below:


> print {$handle} <STDIN>;

The above is a terrible way to copy a file:
- in unnecessarily loads the whole file into memory;
- it reads line-by line, which is slower than reading by blocks.

The following is more efficient and less wasteful:

  my($nbytes,$buff);
  while (($nbytes=read(STDIN,$buff,32768)) > 0)
    { print {$handle} ($buff) or die "Error writing: $!" }
  defined $nbytes or die "Error reading: $!";



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to