# Hadoop vs. Spark: Impact on Performance of the Hammer Query Engine for Open Data Corpora
## 6 Experimental Campaign
### Results
#### 6.2.2. Hadoop vs. Spark Comparison  
We now compare performance exhibited by the basic Map-Reduce version of the algorithm (described in Section 5.3), executed on environments \(Env_{1}\) (_Hadoop_), \(Env_{2}\) (_Spark_) and \(Env_{3}\) (_Spark_). We now focus on execution times shown by Step 4 of the retrieval technique (Section 3.3). Figure 5 depicts the average execution times of Step 4; blue bars correspond to environment \(Env_{1}\); red bars correspond to environment \(Env_{2}\) and grey bars correspond to environment \(Env_{3}\). The aggregated behavior shown in the figure is the same shown in Figure 4 for the average total execution times; this  
Figure 4: Average execution times. Figure 5: Average execution times for Step 4. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Configuration** & _max\_neigh_ & **1000 Data Sets** & **10,000 Data Sets** & **15,000 Data Sets** \\ \hline \(Conf_{1}\) & & 72.30\% & 62.88\% & 73.86\% \\ \(Conf_{2}\) & 10 & 71.58\% & 61.98\% & 74.40\% \\ \(Conf_{3}\) & & 72.66\% & 59.85\% & 74.89\% \\ \hline \(Conf_{4}\) & & 74.67\% & 59.34\% & 74.87\% \\ \(Conf_{5}\) & 100 & 73.21\% & 61.51\% & 74.96\% \\ \(Conf_{6}\) & & 75.30\% & 58.77\% & 74.97\% \\ \hline \(Conf_{7}\) & & 75.51\% & 59.33\% & 74.92\% \\ \(Conf_{8}\) & 1000 & 74.97\% & 61.21\% & 74.96\% \\ \(Conf_{9}\) & & 75.57\% & 58.79\% & 74.96\% \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Fraction of average execution times for environment \(Env_{1}\) (_Hadoop_ technology) with respect to no Map-Reduce version. confirms that the general behavior is dominated by Step 4, i.e., retrieval of data sets that match the queries to process: the greater the number of indexed data sets, the greater the execution times to find the matching ones. However, we can do an interesting observation (for both Figures 4 and 5): the growth of the data sets of a factor 10 (from 1000 data sets to 10,000 data sets) does not cause a growth of execution times of a factor 10, but only around 3. This is true for all three of the environments. In contrast, further increasing the number of data sets of a factor 1.5 (from 10,000 data sets to 15,000 data sets), execution times grow with a factor 2. This means that the way the Map-Reduce approach parallelizes the execution is the same with both technologies (notice that both environments \(Env_{1}\) and \(Env_{3}\) have the same amount of RAM). Thus, we can conclude that _Spark_ is much more efficient than _Hadoop_ due to critical implementation choices, concerning the way data are distributed to jobs (i.e., the main-memory RDDs). The reader can also observe Table 10, which shows the fraction of execution times exhibited by environments \(Env_{2}\) and \(Env_{3}\) (powered by _Spark_ technology) with respect to execution times exhibited by environment \(Env_{1}\) (powered by _Hadoop_ technology). The percentage is computed for each configuration. In particular, the reader can notice that the best improvements are obtained in the hardest configurations, i.e., with parameter _max_neigh_ set to 1000 (i.e., at most 1000 neighbour queries are generated by Step 3 of the retrieval technique, see Section 3.3). Again, this confirms that _Spark_ technology is very efficient in terms of data distribution to tasks. Charts in Figure 6 are derived from Tables 5-7. In particular, they compare execution times for Step 4. Figure 6a reports execution times for Step 4 reported in Table 5; Figure 6b reports execution times for Step 4 reported in Table 6; Figure 6c reports execution times for Step 4 reported in Table 7.  
Another aspect to analyze is the sensitivity of execution times to the nine different configurations. Specifically, we focus on Step 4, which we already established as being the most expensive step in our retrieval technique. We perform this analysis by means of Table 10 and by means of Figure 6.