Files
zeekay abf99d05fc papers: reorganize into per-paper dirs, add Antje Worring as co-author
Restructured from flat .tex/.pdf files into per-paper subdirectories.
Added Antje Worring as co-author on all papers.
Synced PDFs to pdfs/ for download site.
2026-04-18 21:50:07 -07:00

55 lines
2.3 KiB
TeX

\section{CPU Usage}
%% ============================================================================
\subsection{CPU Cycles Per Message}
\begin{table}[h]
\centering
\caption{CPU cycles per encode+decode round-trip (AMD EPYC 7763 @ 2.45 GHz)}
\label{tab:cpu}
\begin{tabular}{lrrrr}
\toprule
\textbf{Protocol} & \textbf{Cycles (encode)} & \textbf{Cycles (decode)} & \textbf{Total} & \textbf{IPC} \\
\midrule
\rowcolor{luxblue!10}
ZAP & 58 & 16 & 74 & 4.12 \\
FlatBuffers & 64 & 17 & 81 & 3.94 \\
Cap'n Proto & 79 & 27 & 106 & 3.71 \\
gRPC (protobuf) & 130 & 173 & 303 & 2.83 \\
QUIC (raw) & 174 & 208 & 382 & 2.41 \\
Protobuf-mux & 191 & 243 & 434 & 2.19 \\
JSON-RPC & 1,000 & 2,076 & 3,076 & 1.47 \\
\bottomrule
\end{tabular}
\end{table}
ZAP's encode path (58 cycles) consists almost entirely of \texttt{MOV} instructions writing fields into the pre-allocated buffer. The decode path (16 cycles) is even cheaper: header validation (branch + compare) and a struct initialization pointing into the existing buffer.
The IPC (Instructions Per Cycle) column reveals why: ZAP achieves 4.12 IPC, near the theoretical maximum of the AMD Zen 3 microarchitecture (peak 6 IPC for integer). This indicates minimal cache misses, branch mispredictions, and pipeline stalls. JSON-RPC's 1.47 IPC reflects heavy cache pressure from reflection, string scanning, and hash map operations.
\subsection{CPU Profile Breakdown}
\begin{table}[h]
\centering
\caption{CPU time breakdown by category (encode path)}
\label{tab:cpuprofile}
\begin{tabular}{lrrrrr}
\toprule
\textbf{Category} & \textbf{ZAP} & \textbf{FlatBuf} & \textbf{gRPC} & \textbf{Protobuf-mux} & \textbf{JSON} \\
\midrule
Field writes & 89\% & 72\% & 31\% & 24\% & 8\% \\
Schema/vtable & 0\% & 18\% & 0\% & 0\% & 0\% \\
Varint encode & 0\% & 0\% & 28\% & 22\% & 0\% \\
Memory alloc & 0\% & 0\% & 19\% & 21\% & 14\% \\
String format & 0\% & 0\% & 0\% & 0\% & 52\% \\
Reflection & 0\% & 0\% & 0\% & 0\% & 18\% \\
Overhead & 11\% & 10\% & 22\% & 33\% & 8\% \\
\bottomrule
\end{tabular}
\end{table}
ZAP spends 89\% of CPU time on actual field writes. gRPC splits between field writes (31\%), varint encoding (28\%), and memory allocation (19\%). JSON-RPC spends 52\% on string formatting alone.
%% ============================================================================