## 7 Bottlenecks Investigation
### Spring Data JPA Bottlenecks Investigation  
The experiments demonstrate that Spring Data JPA comes with the least amount of code written, but also with a big overhead in the execution times, in comparison with JPA and Hibernate.  
To locate the bottlenecks, an analysis of the framework methods execution times had to be conducted. This was achieved using YourKit Java Profiler 2022.9. Alongside information about methods and times, it can extract call trees or lists of hot spots, thus facilitating the identification of performance bottlenecks [41].  
Previous research indicated that more than half of performance bottlenecks originate in the data access layer [42]. The current analysis intended to locate more accurately the bottlenecks and to retrieve the top five hot spots for each RDBMS for runs with the number of entries starting from 50k and comparing them with the top five hot spots (% of running time) for a 50k run with Hibernate.  
The potential differences found after this comparison could explain the overhead observed for Spring Data JPA. These differences would then be investigated to see if there is something extra that the Spring solution verifies.  
The percentage of time spent on the most time-consuming methods identified using YourKit Java Profiler is presented in the Figures 40-51, using RDBMS, framework, and the number of entries (100% means the execution time of the test).  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Operation**} & \multicolumn{3}{c}{**Current Research**} & \multicolumn{3}{c}{**Previous Research**} \\ \cline{2-7}  & **JPA** & **Hibernate** & **Spring Data JPA** & **JPA** & **Hibernate** & **Spring Data JPA** \\ \hline Create & 39,153 & 40,688 & 40,862 & 16,463 & 16,512 & 59,629 \\ \hline Read & 287 & 278 & 542 & 344 & 362 & 2252 \\ \hline Update & 32,834 & 31,887 & 51,424 & 16,355 & 16,276 & 75,071 \\ \hline Delete & 39,249 & 40,001 & 73,632 & 12,768 & 12,857 & 79,799 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Results for both solutions for 50k entries on MySQL.  
Figure 41: MySQL—Spring Data JPA hot spots for 50k entries.  
Figure 42: MySQL—Spring Data JPA hot spots for 100k, 200k, and 500k entries.  
Figure 44: Oracle–Spring Data JPA hot spots for 50k entries.  
Figure 45: Oracle–Spring Data JPA hot spots for 100k, 200k, and 500k entries.  
Figure 43: Oracle–Hibernate hot spots for 50k entries.  
Figure 46: PostgreSQL—Biprenate hot spots for 50k entries.  
Figure 47: PostgreSQL—Spring Data JPA hot spots for 50k entries.  
Figure 48: PostgreSQL—Spring Data JPA hot spots for 100k, 200k, and 500k entries.  
The main thing that can be noticed from the results above is that Spring Data JPA makes really time-consuming calls with the executeQuery() method, which is missing in the  
Figure 51: SQLServer—Spring Data JPA hot spots for 100k, 200k, and 500k entries.  
Figure 49: SQLServer—Hibernate hot spots for 50k entries.  
Figure 50: SQLServer—Spring Data JPA hot spots for 50k entries.  
Hibernate implementations. That happens because when Spring Data JPA deletes an entry, at first it looks for the entry and then it makes the deletion. The deletions are completed one by one with the deleteAll(Iterable<Ticket>). Since the delete operation is the most time-consuming one, the executeQuery() method becomes one of the most active methods.  
Another interesting fact is that most of the time is spent inside drivers' methods for each RDBMS tested and not in a framework method.