Annotation For benchmark.tcl

Origin for each line in benchmark.tcl from check-in b0e3b6588f:

b0e3b6588f 2019-09-17    1: #! /usr/bin/env tclsh
b0e3b6588f 2019-09-17    2: 
b0e3b6588f 2019-09-17    3: set LIB_SUFFIX [info sharedlibextension]
b0e3b6588f 2019-09-17    4: load -global ./xvfs${LIB_SUFFIX}; # Optional, uses a dispatcher
b0e3b6588f 2019-09-17    5: load ./example-flexible${LIB_SUFFIX} Xvfs_example
b0e3b6588f 2019-09-17    6: 
b0e3b6588f 2019-09-17    7: set benchmarkFormat "%-6s %-5s: %s"
b0e3b6588f 2019-09-17    8: 
b0e3b6588f 2019-09-17    9: proc benchmark {type name code} {
b0e3b6588f 2019-09-17   10: 	time $code 100
b0e3b6588f 2019-09-17   11: 	set time [time $code 10000]
b0e3b6588f 2019-09-17   12: 
b0e3b6588f 2019-09-17   13: 	puts [format $::benchmarkFormat $type $name $time]
b0e3b6588f 2019-09-17   14: }
b0e3b6588f 2019-09-17   15: 
b0e3b6588f 2019-09-17   16: set rootDirMap(xvfs) "//xvfs:/example"
b0e3b6588f 2019-09-17   17: set rootDirMap(native) [file join [pwd] example]
b0e3b6588f 2019-09-17   18: 
b0e3b6588f 2019-09-17   19: set test(CD) {
b0e3b6588f 2019-09-17   20: 	cd $::rootDir
b0e3b6588f 2019-09-17   21: 	pwd
b0e3b6588f 2019-09-17   22: }
b0e3b6588f 2019-09-17   23: 
b0e3b6588f 2019-09-17   24: set test(Read) {
b0e3b6588f 2019-09-17   25: 	set fd [open ${::rootDir}/main.tcl]
b0e3b6588f 2019-09-17   26: 	read $fd
b0e3b6588f 2019-09-17   27: 	close $fd
b0e3b6588f 2019-09-17   28: }
b0e3b6588f 2019-09-17   29: 
b0e3b6588f 2019-09-17   30: set test(Glob) {
b0e3b6588f 2019-09-17   31: 	glob -directory ${::rootDir} *
b0e3b6588f 2019-09-17   32: }
b0e3b6588f 2019-09-17   33: 
b0e3b6588f 2019-09-17   34: foreach {testName testBody} [lsort -stride 2 -dictionary [array get test]] {
b0e3b6588f 2019-09-17   35: 	foreach rootDirType {xvfs native} {
b0e3b6588f 2019-09-17   36: 		set rootDir $rootDirMap($rootDirType)
b0e3b6588f 2019-09-17   37: 		benchmark $rootDirType $testName $testBody
b0e3b6588f 2019-09-17   38: 	}
b0e3b6588f 2019-09-17   39: }