File: stats-tables.tcl

package info (click to toggle)
tcllib 2.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,560 kB
  • sloc: tcl: 306,798; ansic: 14,272; sh: 3,035; xml: 1,766; yacc: 1,157; pascal: 881; makefile: 124; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (53 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

proc row {args} { puts |[join $args \t|]\t| }
proc f   {x}    { format %.2f $x }

set first 1
set max 1114112000 ;# number of codepoints

# Time information manually pulled out of the `bench.log`.

foreach {key time} {
    linear	682m52.782s
    2map	25m54.557s
    ternary	23m16.329s
    binary	21m44.001s
    map		14m11.575s
} {
    set size [file size i.$key/wcswidth.tcl]
    set time [expr [string map {s {} m {*60+} h {*3600+} } $time]]
    
    set pointss [expr {$max/double($time)}]
	      
    if {$first} { set fsize $size ; set fpointss $pointss }
    if {$first} { set lsize $size ; set lpointss $pointss }
    set first no

    set bover [f [expr {$size    / double($fsize)    }]]
    set iover [f [expr {$size    / double($lsize)    }]]
    set bgain [f [expr {$pointss / double($fpointss) }]]
    set igain [f [expr {$pointss / double($lpointss) }]]

    lappend x [list $key $size $bover $iover [f $time] [f $pointss] $bgain $igain]

    set lsize $size ; set lpointss $pointss
}

row Algorithm {Code Size} Overhead Overhead/I Time Points/s Gain Gain/I
row --- ---: ---: ---: ---: ---: ---: ---:
foreach row [lreverse $x] { row {*}$row }

puts ""

row Algorithm {Type Min} Max 50% 90% 99% {Width Min} Max 50% 90% 99%
row --- ---: ---: ---: ---: ---: ---: ---: ---: ---: ---:

foreach p [glob i.*/bench-stats.csv] {
    set c [open $p r]
    gets $c
    gets $c
    lassign [split [gets $c] ,] label _ tmin tmax tm tn tx wmin wmax wm wn wx
    set label [string map {i. {}} $label]
    
    row $label $tmin $tmax $tm $tn $tx $wmin $wmax $wm $wn $wx
}