129 Star 1.3K Fork 255

Troy / bean-searcher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
Troy 提交于 2023-04-12 09:50 . update performance/README.md.

性能对比测试

Bean Searcher 专为效率而生,性能并不是它的主要目的。虽然如此,但性能上也不输其它 ORM,甚至会更强。

测试结论

  • 比 Spring Data Jdbc 高 5 ~ 10
  • 比 Spring Data JPA 高 2 ~ 3
  • 比 MyBatis Plus 高 2 ~ 3
  • 比 原生 MyBatis 高 1 ~ 2

注:以下测试均基于嵌入式数据库 H2 进行,它执行 SQL 的耗时很少,因此 ORM 框架的性能差距才能凸显。 实际在生产环境下用 MySQL 等远程数据库服务时,各框架的整体表现差距并没有这么大。

下面是具体测试案例,大家可以下载代码运行验证:

vs Spring Data Jdbc

对比结果:

查看测试代码

vs Spring Data JPA

对比结果:

查看测试代码

vs 原生 MyBatis

对比结果:

查看测试代码

vs MyBatis Plus

对比结果:

查看测试代码

Java
1
https://gitee.com/troyzhxu/bean-searcher.git
git@gitee.com:troyzhxu/bean-searcher.git
troyzhxu
bean-searcher
bean-searcher
dev

搜索帮助