3 from string import strip
7 smilies = {'slowdown': '☹' , 'speedup': '☺'}
10 line = map(strip, filter(None, line.split(' ')))
13 target, name = line[0:2]
14 factor, dir = line[-2:]
16 name = name.split('-')
17 name, size = '-'.join(name[:-1]), name[-1]
19 target_tests = targets.get(target, {})
20 name_tests = target_tests.get(name, {})
22 name_tests[int(size)] = (factor, dir)
23 target_tests[name] = name_tests
24 targets[target] = target_tests
28 <title>Performance Changes</title>
29 <style type="text/css">/*<![CDATA[*/
30 body { background: white; color: black; }
31 table { border-collapse: collapse; }
33 th, td { border: 1px solid silver; padding: 0.2em; }
34 td { text-align: center; }
35 th:first-child { text-align: left; }
36 th { background: #eee; }
38 /* those colors also should work for color blinds */
39 td.slowdown { background: #f93; }
40 td.speedup { background: #6f9; }
43 <h1>Performance Changes</h1>'''
45 targets = targets.items()
46 targets.sort(lambda a, b: cmp(a[0], b[0]))
48 for target, names in targets:
51 for tests in names.values():
52 for size in tests.keys():
59 names.sort(lambda a, b: cmp(a[0], b[0]))
61 print '<h2><a name="%s">%s</a></h2>' % (target, target)
62 print '<table><thead><tr><th> </th>'
65 print '<th>%s</th>' % size
67 print '</tr></thead><tbody>'
69 for name, tests in names:
70 print '<tr><th>%s</th>' % name
73 result = tests.get(size)
77 print '<td class="%s">%s %s</td>' % (
78 dir, factor, smilies[dir])
81 print '<td> </td>'
86 print '</tbody></table>'
88 print '</body></html>'