Overview
SHA1 Hash: | 05f9c95573a075fa7fdbf3175c1e328a3f42b471 |
---|---|
Date: | 2007-10-24 14:44:57 |
User: | aku |
Comment: | Extended pass manager to keep timing data for the executed passes and show them after completion of all passes. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/cvs2fossil/lib/c2f_pass.tcl from [ddf979344e] to [6faa3b2682].
@@ -97,15 +97,10 @@ typemethod run {} { if {$mystart < 0} {set mystart 0} if {$myend < 0} {set myend [expr {[llength $mypasses] - 1}]} - # TODO: Timing statistics for the passes. - # TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?) - # TODO: - # TODO: - set skipped [lrange $mypasses 0 [expr {$mystart - 1}]] set run [lrange $mypasses $mystart $myend] set defered [lrange $mypasses [expr {$myend + 1}] end] foreach p $skipped { @@ -116,20 +111,36 @@ log write 0 pass "Setup $p" Call $p setup } foreach p $run { log write 0 pass "Begin $p" - Call $p run + Time $p [lindex [time {Call $p run} 1] 0] log write 0 pass "Done $p" trouble abort? } foreach p $defered { log write 0 pass "Defer $p" Call $p discard } state release + ShowTimes + return + } + + proc Time {pass useconds} { + ::variable mytime + lappend mytime $pass $useconds + return + } + + proc ShowTimes {} { + ::variable mytime + foreach {pass useconds} $mytime { + set sec [format %8.2f [expr {double($useconds)/1e6}]] + log write 0 pass "$sec sec/$pass" + } return } # # ## ### ##### ######## ############# ## Internal methods @@ -170,10 +181,11 @@ typevariable mydesc -array {} ; # Pass descriptions (one line). typevariable mycmd -array {} ; # Pass callback command. typevariable mystart -1 typevariable myend -1 + typevariable mytime {} ; # Timing data for each executed pass. # # ## ### ##### ######## ############# ## Configuration pragma -hasinstances no ; # singleton