% $Id: exp.tex,v 1.6 1997/02/01 19:35:15 cierniak Exp $


\section{Experiments}
\label{sec:exp}

We perform our optimizations using the kaffe JIT
compiler~\cite{kaffe-v0.5.5}.  To test the impact of the optimizations
on machines with different memory and processor characteristics, we
run our experiments on two computers running Linux: one is equipped
with a 66MHz Intel486 processor, the other one has a 200MHz Pentium
Pro processor.





\subsection{Array layout optimizations}

%\begin{tabular}[htbp]{|l|c|c|}
%  \hline
%  Program & speedup on i486 & speedup on Pentium Pro \\
%  \hline
%  mxm200 & 17\% & 14\% \\
%  mxm300 & 17\% & 10\% \\
%  mxm400 & -- & 12\% \\
%  cholesky & 13\% & 17\% \\
%  \hline
%\end{tabular}

We test our optimizations on two programs ported by us directly from
their Fortran versions included in the SPEC
CFP92~\cite{Dixit-SPEC-1991} benchmark suite: mxm and vpenta.





\subsection{Field layout optimizations}

%\begin{tabular}[htbp]{|l|c|c|}
%  \hline
%  Program & speedup on i486 & speedup on Pentium Pro \\
%  \hline
%  biblio/author & 38\% & 30\% \\
%  biblio/year & 17\% & 50\% \\
%  Bellman-Ford & 10\% & 20\% \\
%  \hline
%\end{tabular}

We show field layout optimizations on two benchmarks.
\begin{itemize}
\item A bibliography program keeps a collection of entries
  representing bibliographical references.  We measure the times to
  perform two counting operations: by author and by year.  We decided
  to time two operations accessing different fields to reduce the
  possibility that optimizing for one operation will decrease
  performance of another operation.
\item An implementation of the Bellman-Ford algorithm for calculating
  shortest paths in a graph.
\end{itemize}


\subsection{Results}

We present normalized running times for our set of five benchmarks in
Figures~\ref{fig:results:mars} and~\ref{fig:results:ppro}.
\begin{figure}[hbt]
  \centerline{\psfig{figure=results486.eps,height=2.6in,width=3.4in}}
  \caption{Speedups achieved on an i486/66 PC}
  \label{fig:results:mars}
\end{figure}

\begin{figure}[hbt]
  \centerline{\psfig{figure=resultsPPro.eps,height=2.6in,width=3.4in}}
  \caption{Speedups achieved on a PentiumPro/200 PC}
  \label{fig:results:ppro}
\end{figure}

The improvements for array-based optimizations are smaller than the
speedups for field-layout optimizations and significantly smaller than
improvements for the same programs implemented in programming
languages like Fortran and C.  We attribute that to relatively
immature compiler technology for Java.  Even a simple access (indexed
by loop variables, like {\tt a[i][j]}) to an element of a
two-dimensional array is translated by the JIT compiler used by us to
a sequence of many instructions including two conditional branches and
11 memory operations.

