[SunHELP] insert one line at beginning of text file; efficiently

Phil Stracchino alaric at caerllewys.net
Wed Sep 3 17:22:52 CDT 2003


On Wed, Sep 03, 2003 at 05:45:20PM -0400, Dale Ghent wrote:
> On Wednesday, September 3, 2003, at 05:21 PM, Phil Stracchino wrote:
> >Don't you think it's a bit wasteful starting up a whole Perl 
> >interpreter
> >to do something this trivial?
> 
> What is it wasting, exactly? Gas? Trees? Water? Air?

CPU time and process space which, if this is handling events that are
being generated at a high rate, could become pretty significant.  The
actual processing required to do this task, especially with a "cached"
blank line in a preexisting file, is tiny compared to the overhead of
firing up a Perl interpreter to handle *each request*.  But if I
understood the original poster correctly, a shell is already running.
The overhead of a single cat executed by that existing shell is
miniscule.


-- 
 .*********  Fight Back!  It may not be just YOUR life at risk.  *********.
 : phil stracchino : unix ronin : renaissance man : mystic zen biker geek :
 :  alaric at caerllewys.net : alaric-ruthven at earthlink.net : phil at latt.net  :
 :   2000 CBR929RR, 1991 VFR750F3 (foully murdered), 1986 VF500F (sold)   :
 :    Linux Now!   ...Because friends don't let friends use Microsoft.    :



More information about the SunHELP mailing list