Re: Program effeciency due to comments..

From: Ed Morton (mortonAVOIDINGSPAM_at_Lucent.com)
Date: 10/24/03


Date: Fri, 24 Oct 2003 14:42:59 -0500


On 10/24/2003 1:51 PM, phud wrote:
> It was a purely theoretical question, so I won't be able to show you any
> test results. But if i ever write a 10000 lines of shell script, I'll
> benchmark it for sure and post the results here. =)

Here's how to do that quickly - put this in an executable file called gen.ksh:

---------------------------
i=0
while (( $i < 10000 ))
do
        cat <<! > run.ksh
echo "All work and no play makes Jack a dull boy"
!
        cat <<! > runC.ksh
# All work and no play makes Jack a dull boy
echo "All work and no play makes Jack a dull boy"
!
        i=$(( $i + 1 ))
do
chmod oug+x run.ksh
chmod oug+x runC.ksh
-------------------------

Then execute "gen.ksh" which will generate "run.ksh". Now execute these commands:

time run.ksh
time runC.ksh

You MAY want to redirect stdout to stderr 8-). Obviously you can change the
"echo" lines to whatever you like.

Enjoy...

        Ed.
>
>
> Thanks for the comments!
>
>
> --
> Posted via http://dbforums.com



Relevant Pages

  • Re: Merging/Joining AoA
    ... I think you forgot to include the POD: ... All work and no play makes Jack a dull boy ...
    (comp.lang.perl.misc)
  • Re: Random
    ... swimming around in a box. ... All work and no play makes Jack a dull boy. ...
    (uk.rec.motorcycles)
  • Re: magic /dev/null
    ... I had a very large data file with hundreds of thousands of records, but my nawk script was only interested in about ten percent of them. ... All work and no play makes Jack a dull boy. ...
    (comp.unix.shell)
  • Re: Ray Martinez
    ... Why not just ask the horse himself? ... "All work and no play makes Jack a dull boy." ...
    (talk.origins)
  • Partially visible frame
    ... * Too much work and no play makes Jack a dull boy. ... The way to go should be with partially visible frames. ...
    (comp.infosystems.www.authoring.html)