Dear,

After SHAWN reaction we have make some effort to the program.
We have make the following changes:


  • additional option /Performance, which will not show
    a progress bar during execution but it only show a performance
    report (elapse time, total lines of execution). the option
    /Progress will slow down the execution of your script.
    We found a factor 5-10. reason: screen output slow it down.
  • output will be redirected to screen before it starts the
    presentation of summary report.
  • we reserve names with the prefix $perf_ for future
    developments.
    [list]

    Code created by the option /Performance

    code:

    $perf_cur= 1 gosub "perf_info" ; - code -
    ...
    $perf_cur= 341 gosub "perf_info" ; - code -

    IF (RedirectOutput("") = 0)
    ENDIF
    CLS
    at(9,26) "Kixtart Performance Progress Report"
    box(10,5,12,75,"single")
    $perf_column=6
    DO
    at(11,$perf_column) " "
    $perf_column=$perf_column+1
    UNTIL ($perf_column >= 75)
    box(14,5,16,75,"single")
    $perf_percentage=(100*$perf_cur) /$perf_stop
    at(13,30) substr(" ",1,3-len("$perf_percentage")) $perf_percentage " %"
    at(15,26) substr(" ",1,7-len("$perf_cur")) $perf_cur " .. " $perf_stop
    at(15,45) "total statements: " $perf_total
    $perf_stop_time=@time
    $perf_start_stime=3600*substr($perf_start_time,1,2)+60*substr($perf_start_time,4,2)+substr($perf_start_time,7,2)
    $perf_stop_stime=3600*substr($perf_stop_time,1,2)+60*substr($perf_stop_time,4,2)+substr($perf_stop_time,7,2)
    $perf_elapse_time=$perf_stop_stime - $perf_start_stime
    at(11,25) $perf_start_time " .. " $perf_stop_time
    at(11,55) "elapse: " $perf_elapse_time " sec"
    at(20,1) " "
    EXIT
    :perf_info
    $perf_stop=341
    IF ($perf_cur <= 1)
    $perf_start_time=@time
    $perf_total=0
    ENDIF
    $perf_total=$perf_total+1
    RETURN


    Code created by the option /Progress

    code:

    $perf_cur= 1 gosub "perf_info" ; - code -
    ....
    $perf_cur= 341 gosub "perf_info" ; - code -

    IF (RedirectOutput("") = 0)
    ENDIF
    CLS
    at(9,26) "Kixtart Performance Progress Report"
    box(10,5,12,75,"single")
    $perf_column=6
    DO
    at(11,$perf_column) " "
    $perf_column=$perf_column+1
    UNTIL ($perf_column >= 75)
    box(14,5,16,75,"single")
    $perf_percentage=(100*$perf_cur) /$perf_stop
    at(13,30) substr(" ",1,3-len("$perf_percentage")) $perf_percentage " %"
    at(15,26) substr(" ",1,7-len("$perf_cur")) $perf_cur " .. " $perf_stop
    at(15,45) "total statements: " $perf_total
    $perf_stop_time=@time
    $perf_start_stime=3600*substr($perf_start_time,1,2)+60*substr($perf_start_time,4,2)+substr($perf_start_time,7,2)
    $perf_stop_stime=3600*substr($perf_stop_time,1,2)+60*substr($perf_stop_time,4,2)+substr($perf_stop_time,7,2)
    $perf_elapse_time=$perf_stop_stime - $perf_start_stime
    at(11,25) $perf_start_time " .. " $perf_stop_time
    at(11,55) "elapse: " $perf_elapse_time " sec"
    at(20,1) " "
    EXIT
    :perf_info
    $perf_stop=341
    IF ($perf_cur <= 1)
    CLS
    at(9,26) "Kixtart Performance Progress Report"
    box(10,5,12,75,"single")
    box(14,5,16,75,"single")
    $perf_column=6
    $perf_start_time=@time
    $perf_total=0
    ENDIF
    $perf_percentage=(100*$perf_cur) /$perf_stop
    IF ($perf_column > 74)
    $perf_column=6
    ENDIF
    $perf_column=6+((74-6)*$perf_percentage) /100
    $perf_total=$perf_total+1
    at(11,$perf_column) "#"
    at(13,30) substr(" ",1,3-len("$perf_percentage")) $perf_percentage " %"
    at(15,26) substr(" ",1,7-len("$perf_cur")) $perf_cur " .. " $perf_stop
    at(20,1) " "
    RETURN


    Conclusions:
    [list]

  • output to screen about progress of script will slowdown
    script dramatically.
  • output at the end of script doesn't slowdown it dramatically.
    we found a factor 1.25-1.5
  • sometimes you will see an anormous amount of statements
    which were executed. reason: "LOOP" structures.
  • sometimes you will see that only a fraction of your script
    will be executed. reason: "IF/ELSE/ENDIF" structures without
    a lot of "LOOP" structures.

site: http://home.wanadoo.nl/scripting/
program: kixstrip.exe vs 1.73

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA