in reply to Re^2: Redirect data and Filehandle manipulation (STDIN x Disk IO)
in thread Redirect data and Filehandle manipulation (STDIN x Disk IO)

To be honest, I would still use a temp file. And then, because this is perl, you could change it from an IO::File to an IO::Scalar later and compare if you're really saving any clock time. I'm betting it's not going to be significant on most modern hardware and OS. HD speeds continue to improve, as do the caching algorithms of the OS.

This smells of premature optimisation to me.

  • Comment on Re^3: Redirect data and Filehandle manipulation (STDIN x Disk IO)

Replies are listed 'Best First'.
Re^4: Redirect data and Filehandle manipulation (STDIN x Disk IO)
by mda2 (Hermit) on Jul 01, 2005 at 19:38 UTC
    I'm using 5 dell servers (2 Xeon 3.2, 2GB ram, hds scsi, inet gbit), on normal traffic 1 G messages daily, but frequently we are target from spams/worms, and content filter is my task to improve performace...

    With normal usage of STDIN or temp file is equal, on hush hours it's the disk io is problem...

    I'm trying it before propose changes on content filter method...

    Perhaps this is exaggerates, but the profit called me attention. Other plataform changes are possible... :(

    --
    Marco Antonio
    Rio-PM

Re^4: Redirect data and Filehandle manipulation (STDIN x Disk IO)
by mda2 (Hermit) on Jul 01, 2005 at 22:44 UTC
    Really... I lost us time... it's don't functional with postfix content-filter (node updated).
    I getting all content into a scalar, considering memory/disk io speed, max message size and process limits (to don't use swap).

    Thank's by your attemption!

    --
    Marco Antonio
    Rio-PM