a08b4fc6c87884591ac5f92c4f7fa2f775dcedcb
[p2p-kernel-protocol.git] / doc / src / results.tex
1 \section{Results}
2 \label{sec:results}
3
4 We want to view if our implementation is viable in terms of performances. To do this we compare our results with the results of \texttt{sendfile} system call. The \texttt{sendfile} command (\textbf{ssize\_t sendfile(int} \textit{out\_fd,} \textbf{int} \textit{in\_fd,} \textbf{off\_t *}\textit{offset,} \textbf{size\_t} \textit{count}\textbf{);}) is used to send \texttt{count} bytes from \texttt{in\_fd} to \texttt{out\_fd}.
5
6 \begin{table}
7         \begin{center}
8         \begin{tabular}{| c | c | c | c | c | c |}
9                 \hline
10                 Sent(MB) & \multicolumn{5}{|c|} {Time}  \\
11                 \cline{2-6}
12                 & one peer & two peers & tree peers & six peers & eight peers\\
13                 \hline
14                 32 & 4 & 10 & 18 & 49 & 61 \\
15                 \hline
16                 64 & 10 & 20 & 35 & 80 & 115 \\
17                 \hline
18                 128 & 20 & 42 & 58 & 226 & 347\\
19                 \hline
20                 256 & 41 & 75 & 129 & 385 & 534 \\
21                 \hline
22         \end{tabular}
23         \end{center}
24         \caption{Sendfile Results}
25         \label{sendfile-results}
26 \end{table}
27
28 In the first test we sent files of 32, 64, 128 and 256 MB from one node to a different number of peers. We varied the number of peers from 1 to 8. The results can be seen in Table \ref{sendfile-results}. We can see that the time needed to send files of different size grows almost linearly, with a factor smaller than 1. This is expected because for each peer we execute a different sendfile system call.
29
30 In the second test, we used our peer-to-peer kernel protocol also on files with size growing from 32MB to 256MB. The number of peers used in test was varied from 1 to 8. The results presented in Table \ref{p2pkp-results}, show an almost linear growth of the time needed to send the files from the sender to peers but with a smaller factor than in the case of \texttt{sendfile}. For small number of peers, one two or three, the results were better in the tests made with sendfile, but for a greater number of peers the results are better when using the p2pkp.
31
32 \begin{table}
33         \begin{center}
34         \begin{tabular}{| c | c | c | c | c | c |}
35                 \hline
36                 Sent(MB) & \multicolumn{5}{|c|} {Time}  \\
37                 \cline{2-6}
38                 & one peer & two peers & tree peers & six peers & eight peers\\
39                 \hline
40                 32 & 13 & 29 & 35 & 45 & 53 \\
41                 \hline
42                 64 & 34 & 53 & 67 & 103 &  125 \\
43                 \hline
44                 128 & 66 & 118 & 142 & 167 &  197 \\
45                 \hline
46                 256 & 121 & 223 & 277 & 378 & 446 \\
47                 \hline
48         \end{tabular}
49         \end{center}
50         \caption{P2PKP Results}
51         \label{p2pkp-results}
52 \end{table}
53
54 We also made a graphic shown in Figure \ref{fig:comp} to view more clearly the differences between sendfile and peer-to-peer kernel protocol. As we can see, with the increase of the number of peers p2pkp become more and more good, and finally overcame the performances of sendfile.
55
56 \begin{figure}[h!]
57         \centering
58         \includegraphics[scale=0.6]{img/comparison.png}
59         \caption{Comparison}
60         \label{fig:comp}
61 \end{figure}
62