# Hadoop vs. Spark: Impact on Performance of the Hammer Query Engine for Open Data Corpora
## 6 Experimental Campaign
### Results
#### 6.2.1 Effect of Introducing Map-Reduce  
Let us start by evaluating the effect of introducing Map-Reduce. Figure 4 compares the overall average execution times of the \(No\)\(MR\) version (yellow line) with _Hadoop_ and _Spark_ versions on execution environments \(Env_{1}\), \(Env_{2}\) and \(Env_{3}\). Table 9 shows the percentage of total execution times of \(Env_{1}\) with respect to version \(No\)\(MR\), for the nine different configurations. Figure 5 compares only average execution times exhibited by Step 4 only (again, the yellow bars correspond to version \(No\)\(MR\)).  
Notice that, without changing the structure of the algorithm (as described in Section 5.3), the introduction of Map-Reduce is beneficial. In fact, even though the _Hadoop_ version is the slowest among the Map-Reduce based ones, parallelism is effective in reducing execution times. Even though we can guess that the bottleneck of the process is accessing _MongoDB_ server, the gain is from 30 to 40%.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**1000 Data Sets** & **Step 1** & **Step 2** & **Step 3** & **Step 4** & **Step 5** & **Step 6** & **Total** \\ \hline \(Conf_{1}\) & 17,231 & 56 & 307 & 34,855 & 9297 & 187,456 & 249,202 \\ \(Conf_{2}\) & 17,545 & 41 & 98 & 45,909 & 10,955 & 216,205 & 290,753 \\ \(Conf_{3}\) & 32,890 & 67 & 82 & 21,395 & 12,443 & 7863 & 74,740 \\ \(Conf_{4}\) & 31,910 & 55 & 58 & 160,793 & 3942 & 107,867 & 304,625 \\ \(Conf_{5}\) & 31,496 & 37 & 113 & 162,115 & 49,055 & 107,704 & 350,520 \\ \(Conf_{6}\) & 25,035 & 44 & 50 & 128,205 & 6499 & 15,558 & 175,391 \\ \(Conf_{7}\) & 31,773 & 65 & 60 & 685,682 & 5086 & 161,219 & 883,885 \\ \(Conf_{8}\) & 31,291 & 44 & 121 & 694,931 & 59,583 & 165,700 & 951,670 \\ \(Conf_{9}\) & 35,301 & 50 & 62 & 532,704 & 4418 & 14,249 & 586,784 \\ \hline
**10,000 Data Sets** & **Step 1** & **Step 2** & **Step 3** & **Step 4** & **Step 5** & **Step 6** & **Total** \\ \hline \(Conf_{1}\) & 9303 & 68 & 1062 & 45,887 & 125,741 & 175,371 & 357,432 \\ \(Conf_{2}\) & 8869 & 85 & 221 & 60,440 & 114,015 & 190,165 & 373,795 \\ \(Conf_{3}\) & 17,773 & 53 & 165 & 28,167 & 45,651 & 22,011 & 113,820 \\ \(Conf_{4}\) & 19,821 & 90 & 182 & 211,685 & 68,331 & 178,282 & 478,391 \\ \(Conf_{5}\) & 9750 & 77 & 252 & 213,426 & 852,953 & 176,880 & 1,253,338 \\ \(Conf_{6}\) & 9256 & 32 & 105 & 168,783 & 30,336 & 56,555 & 265,067 \\ \(Conf_{7}\) & 5622 & 49 & 192 & 902,706 & 69,612 & 105,866 & 1,084,047 \\ \(Conf_{8}\) & 12,966 & 71 & 328 & 914,883 & 747,183 & 247,683 & 1,923,114 \\ \(Conf_{9}\) & 10,942 & 94 & 210 & 662,619 & 29,142 & 66,720 & 769,727 \\ \hline
**15,000 Data Sets** & **Step 1** & **Step 2** & **Step 3** & **Step 4** & **Step 5** & **Step 6** & **Total** \\ \hline \(Conf_{1}\) & 10,199 & 25 & 923 & 48,677 & 49,986 & 156,749 & 266,559 \\ \(Conf_{2}\) & 7670 & 172 & 184 & 64,115 & 71,638 & 214,906 & 358,685 \\ \(Conf_{3}\) & 17,667 & 55 & 203 & 29,880 & 85,437 & 39,558 & 172,800 \\ \(Conf_{4}\) & 20,328 & 90 & 197 & 224,558 & 251,477 & 154,802 & 651,452 \\ \(Conf_{5}\) & 9785 & 76 & 288 & 226,405 & 909,965 & 175,549 & 1,322,068 \\ \(Conf_{6}\) & 8422 & 34 & 117 & 179,047 & 56,097 & 53,141 & 296,858 \\ \(Conf_{7}\) & 6911 & 51 & 232 & 957,602 & 244,116 & 111,814 & 1,320,726 \\ \(Conf_{8}\) & 12,380 & 76 & 366 & 970,519 & 124,3109 & 142,489 & 2,368,939 \\ \(Conf_{9}\) & 12,129 & 88 & 230 & 594,276 & 73,225 & 48,186 & 728,134 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Execution times for the corpus of 1000–10,000–15,000 data sets for version _Spark V2_.