\chapter{Benchmarking}
\label{chapter:benchmarking}
This chapter will research the real world capabilities of MagSend. I attempt to transmit a message using different speeds of MagSend under different system CPU loads to see how it performs and which transfer speed is the most reliable to use.

The following benchmark test are structured in the same way. I run each test 5 times to get a more accurate view of the test. For each test I note if MagSend can detect the preamble, the received payload length, whether the \gls{crc} is valid and the received message.

The message used in the test transmissions is "\textbf{Test}".


\section{25\% CPU Load}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 25\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}

\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 25\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}

\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 25\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}

\section{50\% CPU Load}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 50\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}

\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 50\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}

\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 50\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}

\section{75\% CPU Load}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 75\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}

\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 75\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}

\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
    \begin{bfhTabular}{l l l l l}
        Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
        1 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        2 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        3 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        4 & Preamble Detected & Payload Length & CRC Valid  & Test\\
        5 & Preamble Detected & Payload Length & CRC Valid & Test
    \end{bfhTabular}
    \caption{Benchmark - 75\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}


// TODO: Add graphs to each benchmark
// TODO: Power Supply
