File: report-time.rb

package info (click to toggle)
acl2 8.5dfsg-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 991,452 kB
  • sloc: lisp: 15,567,759; javascript: 22,820; cpp: 13,929; ansic: 12,092; perl: 7,150; java: 4,405; xml: 3,884; makefile: 3,507; sh: 3,187; ruby: 2,633; ml: 763; python: 746; yacc: 723; awk: 295; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (37 lines) | stat: -rwxr-xr-x 1,146 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/env ruby

# Milawa Time Report Tool - Jared Davis (jared@cs.utexas.edu)
#
# You just feed this the output from Milawa, and it tells you which events tool
# the longest.  Note that GC performance can randomly make some events look bad
# even when it's "not their fault."
#
# Example Usage:
#
#   ./report-time.rb < utilities.ccl-image.out
#
# Example Output
#
#     43.62   VERIFY FORCING-TRICHOTOMY-OF-<< (#1616)
#     34.27   VERIFY ORDERED-SUBSETP-IS-TRANSITIVE (#1499)
#     31.26   VERIFY LEMMA2-FOR-GATHER-CONSTANTS-FROM-EQUAL-OF-PLUS-AND-PLUS (#265)
#     28.01   VERIFY EQUAL-OF-APP-AND-APP-WHEN-EQUAL-LENS (#446)
#     27.75   VERIFY CONS-LISTP-OF-REMOVE-SUPERSETS1 (#1000)
#     ... and so on ...

data = Array.new

while line = STDIN.gets
   case line
     when /([0-9]+)> (VERIFY|DEFINE) (.*)/
        current = { :event => $1, :type => $2, :name => $3 }
     when /;; (VERIFY|DEFINE) took ([0-9]+\.[0-9]+) seconds/
        current[:time] = $2.to_f
        data.push(current)
   end
end

sorted = data.sort_by { |x| -x[:time] }
sorted.each { |x|
  printf("%10.2f   %s %s (#%s)\n", x[:time], x[:type], x[:name], x[:event])
}