Spring Boot JPA vs. JDBC: How Much Can a Small App Save?

(pvrlabs.xyz)

4 points | by fksubs 7 hours ago ago

5 comments

  • rusanoph 7 hours ago ago

    I expected JDBC to have a smaller memory footprint, but the startup time difference is quite substantial. I noticed the experiment record linked at the bottom. Does it also include the complete source code for both application variants?

    • fksubs 7 hours ago ago

      The article references experiment details https://github.com/PVRLabs/experiments/tree/main/spring-boot..., but I hadn't explored it much.

      What surprised you? I thought the experiment simply demonstrated that there is a noticeable overhead in using JPA with small apps.

    • fksubs 7 hours ago ago

      I think the startup difference comes from classloading costs. It simply takes much longer for Hibernate stuff to load initially.

      • rusanoph 6 hours ago ago

        You're right, I misread the results. But by the way, it seems additional overhead also arises from building entity models in memory and initializing other heavy classes, such as EntityManagerFactory.

        • rusanoph 6 hours ago ago

          Also, thanks for sources!