Author: David Schneider <david.schnei...@picle.org> Branch: extradoc Changeset: r4401:97526b6a35cf Date: 2012-08-01 18:15 +0200 http://bitbucket.org/pypy/extradoc/changeset/97526b6a35cf/
Log: generate a table showing only the percentage of guards before and after optimization for the set of benchmarks 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 +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 pdflatex paper bibtex paper pdflatex paper diff --git a/talk/vmil2012/paper.tex b/talk/vmil2012/paper.tex --- a/talk/vmil2012/paper.tex +++ b/talk/vmil2012/paper.tex @@ -109,12 +109,12 @@ intermediate and low-level representation of the JIT instructions and how these are implemented. -\begin{figure*} - \include{figures/ops_count_table} - \caption{Relative numbers of operations in the traces generated for - different benchmarks} - \label{fig:ops_count} -\end{figure*} +%\begin{figure*} +% \include{figures/ops_count_table} +% \caption{Relative numbers of operations in the traces generated for +% different benchmarks} +% \label{fig:ops_count} +%\end{figure*} Although there are several publications about tracing just-in-time compilers, to our knowledge, there are none that describe the use and implementation of guards in this context. With the following contributions we aim to shed some @@ -141,6 +141,11 @@ In this paper we want to substantiate the aforementioned and describe based on them the reasoning behind and the implementation of guards in PyPy's tracing just-in-time compiler. +\begin{figure} + \include{figures/guard_table} + \caption{Percentage of guards before and after optimization for different benchmarks} + \label{fig:guard_percent} +\end{figure} \begin{itemize} \item An analysis of guards in the context of PyPy's tracing JIT to substantiate the aforementioned observation, based on a set of benchmarks. 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 @@ -41,6 +41,25 @@ output = render_table(template, head, sorted(table)) write_table(output, texfile) +def build_guard_table(csvfiles, texfile, template): + assert len(csvfiles) == 1 + lines = getlines(csvfiles[0]) + table = [] + head = ['Benchmark', 'guards b/o in \%', 'guards a/o in \%'] + + keys = 'numeric set get rest new guard '.split() + for bench in lines: + ops = {'before': sum(int(bench['%s before' % s]) for s in keys), + 'after': sum(int(bench['%s after' % s]) for s in keys)} + + res = [bench['bench'].replace('_', '\\_'),] + for t in ('before', 'after'): + o = int(bench['guard %s' % t]) + res.append('%.2f ' % (o / ops[t] * 100)) + table.append(res) + output = render_table(template, head, sorted(table)) + write_table(output, texfile) + def build_benchmarks_table(csvfiles, texfile, template): @@ -140,6 +159,8 @@ (['backend_summary.csv', 'resume_summary.csv'], build_backend_count_table), 'ops_count_table.tex': (['summary.csv'], build_ops_count_table), + 'guard_table.tex': + (['summary.csv'], build_guard_table), } _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit