Differences From:
File
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[ae19c0fcb4]
- Extended pass manager to handle the skipped and defered passes coming before and after the actually executed passes. Extended passes I and II to have the required methods. Implemented loading (for skipped passes) as skeletons, implemented discarding (for defered passes) completely. Extended state manager with ability to discard state.
by
aku on
2007-10-13 23:29:17.
[view]
To:
File
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[38b967dcf5]
- Merge aku's CVS import changes into the main line. Fix a small bug in diff.c.
by
drh on
2007-11-17 00:29:42.
Also file
tools/cvs2fossil/lib/c2f_pass.tcl
part of check-in
[05f9c95573]
- Extended pass manager to keep timing data for the executed passes and show them after completion of all passes.
by
aku on
2007-10-24 14:44:57.
[view]
@@ -98,13 +98,8 @@
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]
@@ -117,9 +112,9 @@
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 {
@@ -127,8 +122,24 @@
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
}
# # ## ### ##### ######## #############
@@ -171,8 +182,9 @@
typevariable mycmd -array {} ; # Pass callback command.
typevariable mystart -1
typevariable myend -1
+ typevariable mytime {} ; # Timing data for each executed pass.
# # ## ### ##### ######## #############
## Configuration