Ignore:
Timestamp:
Mar 19, 2025, 10:15:18 AM (5 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
048dde4
Parents:
bb85f76
Message:

first attempt to use gnuplot for graphs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified doc/theses/mike_brooks_MMath/string.tex

    rbb85f76 ra7d93cb  
    2020@strcat@, @strncat@             & @+@                                   & @+@               & @+@       \\
    2121@strcmp@, @strncmp@             & @==@, @!=@, @<@, @<=@, @>@, @>=@
    22                                                 & @equals@, @compareTo@
    23                                                                                                                     & @==@, @!=@, @<@, @<=@, @>@, @>=@ \\
     22                                                & @equals@, @compareTo@  & @==@, @!=@, @<@, @<=@, @>@, @>=@ \\
    2423@strlen@                                & @length@, @size@              & @length@                      & @size@        \\
    2524@[ ]@                                   & @[ ]@                                 & @charAt@          & @[ ]@     \\
     
    369368
    370369\begin{figure}
    371 \includegraphics{memmgr-basic}
     370\includegraphics{memmgr-basic.pdf}
    372371\caption{String memory-management data structures}
    373372\label{f:memmgr-basic}
     
    578577The \emph{append} tests use the varying-from-1 corpus construction, \ie they do not assume away the STL's advantage for small-string optimization.
    579578\PAB{To discuss: any other case variables introduced in the performance intro}
    580 Figure \ref{fig:string-graph-peq-cppemu} shows this behaviour, by the STL and by \CFA in STL emulation mode.
     579\VRef[Figure]{fig:string-graph-peq-cppemu} shows this behaviour, by the STL and by \CFA in STL emulation mode.
    581580\CFA reproduces STL's performance, up to a 15\% penalty averaged over the cases shown, diminishing with larger strings, and 50\% in the worst case.
    582581This penalty characterizes the amount of implementation fine tuning done with STL and not done with \CFA in present state.
    583582The larger inherent penalty, for a user mismanaging reuse, is 40\% averaged over the cases shown, is minimally 24\%, shows up consistently between the STL and \CFA implementations, and increases with larger strings.
    584583
    585 \PAB{Most of your graphs are unreadable. gnuplot is a good tool for generating high quality graphs.}
    586 
    587584\begin{figure}
    588         \includegraphics[width=\textwidth]{string-graph-peq-cppemu.png}
    589         \caption{Average time per iteration with one \lstinline{x += y} invocation, comparing \CFA with STL implementations (given \CFA running in STL emulation mode), and comparing the ``fresh'' with ``reused'' reset styles, at various string sizes.}
     585\centering
     586        \includegraphics{string-graph-peq-cppemu.pdf}
     587%       \includegraphics[width=\textwidth]{string-graph-peq-cppemu.png}
     588        \caption{Average time per iteration (lower is better) with one \lstinline{x += y} invocation, comparing \CFA with STL implementations (given \CFA running in STL emulation mode), and comparing the ``fresh'' with ``reused'' reset styles, at various string sizes.}
    590589        \label{fig:string-graph-peq-cppemu}
    591590\end{figure}
    592591
    593592\begin{figure}
    594         \includegraphics[width=\textwidth]{string-graph-peq-sharing.png}
    595         \caption{Average time per iteration with one \lstinline{x += y} invocation, comparing \CFA (having implicit sharing activated) with STL, and comparing the ``fresh'' with ``reused'' reset styles, at various string sizes.}
     593\centering
     594        \includegraphics{string-graph-peq-sharing.pdf}
     595%       \includegraphics[width=\textwidth]{string-graph-peq-sharing.png}
     596        \caption{Average time per iteration (lower is better) with one \lstinline{x += y} invocation, comparing \CFA (having implicit sharing activated) with STL, and comparing the ``fresh'' with ``reused'' reset styles, at various string sizes.}
    596597        \label{fig:string-graph-peq-sharing}
    597598\end{figure}
    598599
    599 In sharing mode, \CFA makes the fresh/reuse difference disappear, as shown in Figure \ref{fig:string-graph-peq-sharing}.
     600In sharing mode, \CFA makes the fresh/reuse difference disappear, as shown in \VRef[Figure]{fig:string-graph-peq-sharing}.
    600601At append lengths 5 and above, \CFA not only splits the two baseline STL cases, but its slowdown of 16\% over (STL with user-managed reuse) is close to the \CFA-v-STL implementation difference seen with \CFA in STL-emulation mode.
    601602
    602603\begin{figure}
    603         \includegraphics[width=\textwidth]{string-graph-pta-sharing.png}
    604         \caption{Average time per iteration with one \lstinline{x = x + y} invocation (new, purple bands), comparing \CFA (having implicit sharing activated) with STL.
    605 For context, the results from Figure \ref{fig:string-graph-peq-sharing} are repeated as the bottom bands.
     604\centering
     605        \includegraphics{string-graph-pta-sharing.pdf}
     606%       \includegraphics[width=\textwidth]{string-graph-pta-sharing.png}
     607        \caption{Average time per iteration (lower is better) with one \lstinline{x = x + y} invocation (new, purple bands), comparing \CFA (having implicit sharing activated) with STL.
     608For context, the results from \VRef[Figure]{fig:string-graph-peq-sharing} are repeated as the bottom bands.
    606609While not a design goal, and not graphed out, \CFA in STL-emulation mode outperformed STL in this case; user-managed allocation reuse did not affect any of the implementations in this case.}
    607610        \label{fig:string-graph-pta-sharing}
    608611\end{figure}
    609612
    610 When the user takes a further step beyond the STL's optimal zone, by running @x = x + y@, as in Figure \ref{fig:string-graph-pta-sharing}, the STL's penalty is above $15 \times$ while \CFA's (with sharing) is under $2 \times$, averaged across the cases shown here.
     613When the user takes a further step beyond the STL's optimal zone, by running @x = x + y@, as in \VRef[Figure]{fig:string-graph-pta-sharing}, the STL's penalty is above $15 \times$ while \CFA's (with sharing) is under $2 \times$, averaged across the cases shown here.
    611614Moreover, the STL's gap increases with string size, while \CFA's converges.
     615
    612616
    613617\subsubsection{Test: Pass argument}
     
    621625
    622626\begin{figure}
    623         \includegraphics[width=\textwidth]{string-graph-pbv.png}
    624         \caption{Average time per iteration with one call to a function that takes a by-value string argument, comparing \CFA (having implicit sharing activated) with STL.
     627\centering
     628        \includegraphics{string-graph-pbv.pdf}
     629%       \includegraphics[width=\textwidth]{string-graph-pbv.png}
     630        \caption{Average time per iteration (lower is better) with one call to a function that takes a by-value string argument, comparing \CFA (having implicit sharing activated) with STL.
    625631(a) With \emph{Varying-from-1} corpus construction, in which the STL-only benefit of small-string optimization occurs, in varying degrees, at all string sizes.
    626632(b) With \emph{Fixed-size} corpus construction, in which this benefit applies exactly to strings with length below 16.
     
    629635\end{figure}
    630636
    631 Figure \ref{fig:string-graph-pbv} shows the costs for calling a function that receives a string argument by value.
     637\VRef[Figure]{fig:string-graph-pbv} shows the costs for calling a function that receives a string argument by value.
    632638STL's performance worsens as string length increases, while \CFA has the same performance at all sizes.
    633639
     
    674680
    675681\begin{figure}
     682\centering
    676683  \includegraphics[width=\textwidth]{string-graph-allocn.png}
    677684  \caption{Space and time performance, under varying fraction-live targets, for the five string lengths shown, at (\emph{Fixed-size} corpus construction.
     
    682689\end{figure}
    683690
    684 Figure \ref{fig:string-graph-allocn} shows the results of this experiment.
     691\VRef[Figure]{fig:string-graph-allocn} shows the results of this experiment.
    685692At all string sizes, varying the liveness threshold gives offers speed-for-space tradeoffs relative to STL.
    686693At the default liveness threshold, all measured string sizes see a ??\%--??\% speedup for a ??\%--??\% increase in memory footprint.
Note: See TracChangeset for help on using the changeset viewer.