Author: David Schneider <david.schnei...@picle.org>
Branch: extradoc
Changeset: r4486:6ee6eb13d8bb
Date: 2012-08-09 11:32 +0200
http://bitbucket.org/pypy/extradoc/changeset/6ee6eb13d8bb/

Log:    Add a table showing the percentage of guards that ever fail and the
        percentage of guards that fail more than 200 times

diff --git a/talk/vmil2012/Makefile b/talk/vmil2012/Makefile
--- a/talk/vmil2012/Makefile
+++ b/talk/vmil2012/Makefile
@@ -1,5 +1,5 @@
 
-jit-guards.pdf: paper.tex paper.bib figures/log.tex figures/example.tex 
figures/benchmarks_table.tex figures/backend_table.tex 
figures/ops_count_table.tex figures/loop_bridge.pdf figures/guard_table.tex 
figures/resume_data_table.tex
+jit-guards.pdf: paper.tex paper.bib figures/log.tex figures/example.tex 
figures/benchmarks_table.tex figures/backend_table.tex 
figures/ops_count_table.tex figures/loop_bridge.pdf figures/guard_table.tex 
figures/resume_data_table.tex figures/failing_guards_table.tex
        pdflatex paper
        bibtex paper
        pdflatex paper
@@ -18,7 +18,7 @@
 %.tex: %.py
        pygmentize -l python -o $@ $<
 
-figures/%_table.tex: tool/build_tables.py logs/backend_summary.csv 
logs/summary.csv tool/table_template.tex logs/bridge_summary.csv 
logs/resume_summary.csv
+figures/%_table.tex: tool/build_tables.py logs/backend_summary.csv 
logs/summary.csv tool/table_template.tex logs/bridge_summary.csv 
logs/resume_summary.csv logs/guard_summary.json
        tool/setup.sh
        paper_env/bin/python tool/build_tables.py $@
 
diff --git a/talk/vmil2012/paper.tex b/talk/vmil2012/paper.tex
--- a/talk/vmil2012/paper.tex
+++ b/talk/vmil2012/paper.tex
@@ -632,6 +632,13 @@
     \label{fig:resume_data_sizes}
 \end{figure}
 
+\begin{figure}
+    \include{figures/failing_guards_table}
+    \caption{Failing guards}
+    \label{fig:failing_guards}
+\end{figure}
+
+
 \todo{figure about failure counts of guards (histogram?)}
 \todo{add resume data sizes without sharing}
 \todo{add a footnote about why guards have a threshold of 100}
diff --git a/talk/vmil2012/tool/build_tables.py 
b/talk/vmil2012/tool/build_tables.py
--- a/talk/vmil2012/tool/build_tables.py
+++ b/talk/vmil2012/tool/build_tables.py
@@ -1,9 +1,10 @@
 from __future__ import division
 import csv
 import django
-from django.template import Template, Context
+import json
 import os
 import sys
+from django.template import Template, Context
 
 # This line is required for Django configuration
 django.conf.settings.configure()
@@ -15,6 +16,33 @@
         return [l for l in reader]
 
 
+def build_failing_guards_table(files, texfile, template):
+    BRIDGE_THRESHOLD = 200
+    assert len(files) == 2
+    with open(files[1]) as f:
+        failures = json.load(f)
+    for l in getlines(files[0]):
+        failures[l['bench']]['nguards'] = float(l['number of guards'])
+
+    table = []
+    head = ['Benchmark',
+            'failing guards',
+            'over %d failures' % BRIDGE_THRESHOLD]
+
+    for bench, info in failures.iteritems():
+        total = failures[bench]['nguards']
+        total_failures = len(info['results'])
+        bridges = len([k for k,v in info['results'].iteritems() \
+                                            if v > BRIDGE_THRESHOLD])
+        res = [bench.replace('_', '\\_'),
+                "%.2f \\%%" % (100 * total_failures/total),
+                "%.2f \\%%" % (100 * bridges/total),
+        ]
+        table.append(res)
+    output = render_table(template, head, sorted(table))
+    write_table(output, texfile)
+
+
 def build_resume_data_table(csvfiles, texfile, template):
     assert len(csvfiles) == 1
     lines = getlines(csvfiles[0])
@@ -82,6 +110,7 @@
     assert len(csvfiles) == 2
     lines = getlines(csvfiles[0])
     bridge_lines = getlines(csvfiles[1])
+    # keep this around for the assertion bellow
     bridgedata = {}
     for l in bridge_lines:
         bridgedata[l['bench']] = l
@@ -178,6 +207,8 @@
             (['summary.csv'], build_guard_table),
         'resume_data_table.tex':
             (['resume_summary.csv'], build_resume_data_table),
+        'failing_guards_table.tex':
+            (['resume_summary.csv', 'guard_summary.json'], 
build_failing_guards_table),
         }
 
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to