doc: final revise of the document
[p2p-kernel-protocol.git] / doc / src / results.tex
1 \section{Results}
2 \label{sec:results}
3
4 Our goal is to stress our implementation in order to determine if it is
5 viable in terms of performance. In order to achieve this, we have compared our
6 results with the \texttt{sendfile} system call. As already stated in Section
7 \ref{sec:intro}, this function uses a zero-copy mechanism to avoid passing
8 information from kernel space and back.
9
10 \begin{table}
11         \begin{center}
12         \begin{tabular}{| c | c | c | c | c | c |}
13                 \hline
14                 Sent(MB) & \multicolumn{5}{|c|} {Time}  \\
15                 \cline{2-6}
16                 & one peer & two peers & tree peers & six peers & eight peers\\
17                 \hline
18                 32 & 4 & 10 & 18 & 49 & 61 \\
19                 \hline
20                 64 & 10 & 20 & 35 & 80 & 115 \\
21                 \hline
22                 128 & 20 & 42 & 58 & 226 & 347\\
23                 \hline
24                 256 & 41 & 75 & 129 & 385 & 534 \\
25                 \hline
26         \end{tabular}
27         \end{center}
28         \caption{Sendfile Results}
29         \label{sendfile-results}
30 \end{table}
31
32 Section \ref{sec:testing} largely details the test scenarios we have
33 performed. Particularly, this is the test where we varied the number of peers
34 from 1 to 8. The results gathered are displayed in Table \ref{sendfile-results}.
35 We can easily observe that the time needed to send files of different size grows
36 almost linearly, with a factor lower than 1. This was expected because for each
37 peer, we execute at least one more \texttt{sendfile} system call.
38
39 For the second test, we used our peer-to-peer kernel protocol for sending
40 files on with sizes growing from 32MB up to 256MB. The number of peers used in
41 this test was varied from 1 to 8. The results presented in Table,
42 \ref{p2pkp-results}, show an almost linear growth of the time needed to send the
43 files from sender to peers, but with a smaller factor than the one achieved in
44 case of the \texttt{sendfile} system call. For small number of peers, one, two
45 or three, \texttt{senfile} has a higher performance rate, but for a greater
46 number of peers our implementation has better results.
47
48 \begin{table}
49         \begin{center}
50         \begin{tabular}{| c | c | c | c | c | c |}
51                 \hline
52                 Sent(MB) & \multicolumn{5}{|c|} {Time}  \\
53                 \cline{2-6}
54                 & one peer & two peers & tree peers & six peers & eight peers\\
55                 \hline
56                 32 & 13 & 29 & 35 & 45 & 53 \\
57                 \hline
58                 64 & 34 & 53 & 67 & 103 &  125 \\
59                 \hline
60                 128 & 66 & 118 & 142 & 167 &  197 \\
61                 \hline
62                 256 & 121 & 223 & 277 & 378 & 446 \\
63                 \hline
64         \end{tabular}
65         \end{center}
66         \caption{P2PKP Results}
67         \label{p2pkp-results}
68 \end{table}
69
70 We have also compiled a graphic, shown in Figure \ref{fig:comp}, that better
71 exposes the differences between \texttt{sendfile} and the P2PKP kernel module.
72 As we can see, while the number of peers increase, our implementation
73 overcomes the performance of \texttt{sendfile}.
74
75 \begin{figure}[h!]
76         \centering
77         \includegraphics[scale=0.6]{img/comparison.png}
78                 \caption{\texttt{sendfile} vs P2PKP}
79         \label{fig:comp}
80 \end{figure}
81