Art*_*gon 0 performance spring jdbctemplate spring-data-jpa
客户迫使我们使用JdbcTemplate而不是Spring Data Jpa来开发Spring项目。但是,该应用程序在响应速度和传递方面并不关键(它是客户端最终用户的内部Web应用程序)。我们想使用Spring Data Jpa。
问题:是否有一些客观的理由使用JdbcTemplate是因为应用程序的速度快?从我的角度来看,会有不同的瓶颈。
没有指定确切的用例就不可能回答更快的问题。
JdbcTemplate 在谈论纯查询执行时,它将很有可能会更快,因为JPA实现会做更多的事情:
尽管模板(几乎)只是:
ResultSetMapper或类似结果交给您。当然,JPA这样做是有原因的。
And those things have costs beyond performance.
The abstraction JPA offers is actually really complex and leaky and it is not properly understood by most developers using it. While I think it is completely reasonable to use JPA in many contexts, I can also relate to people banning it from their projects. Talking about performance is absolutely too limited in order to make a well-educated decision on this.
| 归档时间: |
|
| 查看次数: |
50 次 |
| 最近记录: |