BeetlSQL 3.23.11 发布,SQL 查询性能提高 40%~300%
- 性能优化:SQL查询后结果映射到Java Entity,性能至少提供40%,有些场景提高300%
- 更好的支持动态表,向操作普通POJO一样操作动态表,比使用Map更方便
- 代码生成支持指定父类
- SQ防火墙的性能部分优化
性能优化结果:
查询 | 优化前(ops/ms) | 优化后(ops/ms) | mybatis |
beetlsqlExecuteJdbc | 222 | 318 | / |
beetlsqlExecuteTemplate | 198 | 268 | 44 |
beetlsqlFile | 191 | 266 | 41 |
beetlsqlGetAll | 5 | 13 | 4 |
beetlsqlLambdaQuery | 150 | 196 | 9 |
beetlsqlPageQuery | 128 | 159 | 17 |
beetlsqlSelectById | 186 | 259 | 43 |
性能优化办法:
优化了Java反射调用,使用生成字节码直接调用,参考BeanASMPerfTest.java, myasm 性能非常接近手写的代码(直接调用),远远高于反射调用,也高于使用其他字节码增强工具reflectAsm
* BeanASMPerfTest.direct(直接调用) thrpt 3 3597282.120 ± 2031070.301 ops/ms
* BeanASMPerfTest.myasm (字节码调用) thrpt 3 1889599.007 ± 1013919.850 ops/ms
* BeanASMPerfTest.propertySet(反射调用) thrpt 3 3462.095 ± 2748.584 ops/ms
* BeanASMPerfTest.reflectAsm(字节码工具) thrpt 3 18580.151 ± 13286.590 ops/ms
动态表支持:方便的通过BeetlSQL访问动态表
SQLManager sqlManager = getSQLManager();
int max = 5;
//创建5个表
for(int i=0;i<max;i++){
String dml="create table my_table"+i+"(id int NOT NULL"
+ ",name varchar(20)"
+ ",PRIMARY KEY (`id`)"
+ ") ";
sqlManager.executeUpdate(new SQLReady(dml));
}
// 配置加载类,使用默认的BassEntity,也可以使用任何类作为父类,比如MyOfficeEntity
DynamicEntityLoader<BaseEntity> dynamicEntityLoader = new DynamicEntityLoader(sqlManager);
for(int i=0;i<max;i++){
//Class<? extends MyOfficeEntity> c = dynamicEntityLoader.getDynamicEntity("my_table"+i,MyOfficeEntity.class);
Class<? extends BaseEntity> c = dynamicEntityLoader.getDynamicEntity("my_table"+i);
long count = sqlManager.allCount(c);
System.out.println(count);
}
for(int i=0;i<max;i++){
Class<? extends BaseEntity> c = dynamicEntityLoader.getDynamicEntity("my_table"+i);
BaseEntity obj = c.newInstance();
obj.setValue("id",1);
obj.setValue("name","hello");
sqlManager.insert(obj);
}
性能增速扩展包
<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>sql-accelerator</artifactId>
<version>3.23.11-RELEASE</version>
</dependency>
动态表支持扩展包
<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>sql-dynamic-table</artifactId>
<version>3.23.11-RELEASE</version>
</dependency>
SQL防火墙扩展包
<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>sql-firewall</artifactId>
<version>3.23.11-RELEASE</version>
</dependency>
BeetlSQL 自主研发自 2015 年,目标是提供开发高效,维护高效,运行高效的数据访问框架,它适用范围广,定制性强,写起数据库访问代码特别顺滑,不亚于 MyBatis。你不想写 SQL 也好,或者想更好地写 SQL 也好,BeetlSQL 都能满足这要求,目前支持的数据库如下
- 传统数据库:MySQL (包括支持 MySQL 协议的各种数据库), MariaDB ,Oralce ,Postgres (包括支持 Postgres 协议的各种数据库), DB2 , SQL Server ,H2 , SQLite , Derby ,神通,达梦,华为高斯,人大金仓,PolarDB,GBase8s,GreatSQL 等
- 大数据:HBase,ClickHouse,Cassandar,Hive,GreenPlum
- 物联网时序数据库:Machbase,TD-Engine,IotDB
- SQL 查询引擎:Drill,Presto,Druid
- 内存数据库:ignite,CouchBase
Benchmark Mode Cnt Score Error Units
JMHMain.beetlsqlComplexMapping thrpt 5 240.875 ± 26.462 ops/ms
JMHMain.beetlsqlExecuteJdbc thrpt 5 318.344 ± 15.416 ops/ms
JMHMain.beetlsqlExecuteTemplate thrpt 5 268.337 ± 16.458 ops/ms
JMHMain.beetlsqlFile thrpt 5 266.299 ± 12.910 ops/ms
JMHMain.beetlsqlGetAll thrpt 5 13.444 ± 0.110 ops/ms
JMHMain.beetlsqlInsert thrpt 5 139.848 ± 67.006 ops/ms
JMHMain.beetlsqlLambdaQuery thrpt 5 196.197 ± 10.572 ops/ms
JMHMain.beetlsqlOne2Many thrpt 5 162.912 ± 7.643 ops/ms
JMHMain.beetlsqlPageQuery thrpt 5 159.421 ± 9.474 ops/ms
JMHMain.beetlsqlSelectById thrpt 5 259.260 ± 12.983 ops/ms
JMHMain.easyQueryComplexMapping thrpt 5 70.631 ± 9.350 ops/ms
JMHMain.easyQueryExecuteJdbc thrpt 5 251.553 ± 13.124 ops/ms
JMHMain.easyQueryGetAll thrpt 5 15.556 ± 0.919 ops/ms
JMHMain.easyQueryInsert thrpt 5 94.289 ± 46.075 ops/ms
JMHMain.easyQueryLambdaQuery thrpt 5 116.482 ± 6.220 ops/ms
JMHMain.easyQueryOne2Many thrpt 5 93.552 ± 7.485 ops/ms
JMHMain.easyQueryPageQuery thrpt 5 79.880 ± 4.101 ops/ms
JMHMain.easyQuerySelectById thrpt 5 118.695 ± 5.622 ops/ms
JMHMain.flexGetAll thrpt 5 2.629 ± 0.175 ops/ms
JMHMain.flexInsert thrpt 5 69.733 ± 9.791 ops/ms
JMHMain.flexPageQuery thrpt 5 44.935 ± 13.077 ops/ms
JMHMain.flexSelectById thrpt 5 69.332 ± 4.738 ops/ms
JMHMain.jdbcExecuteJdbc thrpt 5 692.908 ± 29.405 ops/ms
JMHMain.jdbcGetAll thrpt 5 41.017 ± 0.999 ops/ms
JMHMain.jdbcInsert thrpt 5 235.220 ± 170.271 ops/ms
JMHMain.jdbcSelectById thrpt 5 685.740 ± 21.861 ops/ms
JMHMain.jpaExecuteJdbc thrpt 5 67.159 ± 6.612 ops/ms
JMHMain.jpaExecuteTemplate thrpt 5 75.465 ± 4.267 ops/ms
JMHMain.jpaGetAll thrpt 5 5.279 ± 0.542 ops/ms
JMHMain.jpaInsert thrpt 5 63.982 ± 10.347 ops/ms
JMHMain.jpaOne2Many thrpt 5 105.669 ± 6.529 ops/ms
JMHMain.jpaPageQuery thrpt 5 66.304 ± 4.215 ops/ms
JMHMain.jpaSelectById thrpt 5 344.930 ± 15.419 ops/ms
JMHMain.mybatisComplexMapping thrpt 5 114.651 ± 7.607 ops/ms
JMHMain.mybatisExecuteTemplate thrpt 5 44.020 ± 2.327 ops/ms
JMHMain.mybatisFile thrpt 5 41.459 ± 1.880 ops/ms
JMHMain.mybatisGetAll thrpt 5 4.961 ± 0.197 ops/ms
JMHMain.mybatisInsert thrpt 5 43.624 ± 5.580 ops/ms
JMHMain.mybatisLambdaQuery thrpt 5 9.141 ± 1.295 ops/ms
JMHMain.mybatisPageQuery thrpt 5 17.451 ± 1.409 ops/ms
JMHMain.mybatisSelectById thrpt 5 43.716 ± 4.768 ops/ms
JMHMain.woodExecuteJdbc thrpt 5 106.223 ± 88.136 ops/ms
JMHMain.woodExecuteTemplate thrpt 5 120.959 ± 5.220 ops/ms
JMHMain.woodFile thrpt 5 123.587 ± 9.268 ops/ms
JMHMain.woodGetAll thrpt 5 1.961 ± 0.158 ops/ms
JMHMain.woodInsert thrpt 5 101.279 ± 50.068 ops/ms
JMHMain.woodLambdaQuery thrpt 5 128.158 ± 7.174 ops/ms
JMHMain.woodPageQuery thrpt 5 240.657 ± 13.274 ops/ms
JMHMain.woodSelectById thrpt 5 125.943 ± 5.696 ops/ms

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
DjangoAdmin 敏捷开发框架 FastAPI+EleVue 版本 v2.0.0 发布
v2.0.0 更新内容:1、优化登录功能,增强使用体验;2、优化后台主页,规范页面和功能;3、优化个人中心模块,规范数据;4、优化行政区划选择组件;5、优化配置管理模块;6、修复近期用户反馈的问题; 一款基于Fastapi、Vue、ElementUI、MySQL等技术栈研发的前后端分离开发框架,设计之初就定位为一款高端产品,采用全新的架构设计,后端服务和前端都是采用全新的设计方案,兼容手机、PAD和PC电脑端,具备良好的用户使用体验;框架拥有完善的(RBAC)权限架构和基础核心管理模块,权限控制精细化到按钮节点级别颗粒度控制,根据不同的角色分配不同的权限即可实现;为了避免重复造轮子,系统本身已经集成了基础模块,包括常规的权限管理、字典、配置、行政区划等等常规模块;开发者可以基于框架做二次开发,可以用户个人项目、公司项目以及客户定制化项目,本框架为一站式系统框架开发平台,可以帮助开发者提升开发效率、降低研发成本,同时便于后期的系统维护升级。 软件信息 软件名称:DjangoAdmin敏捷开发框架FastAPI+EleVue版本 官网网址:https://www.djangoadmin.c...
-
下一篇
💖Snowy 快速开发平台 v2.3.0 已发布
此次修复了多个小细节的bug,同时也新增了多项功能,其中有一部分来自于咱群内使用者,请往下看: 效果体现: 新增业务字典功能 升级角色功能,业务管理员可以授权给个人全局角色啦 新增高德地图与百度地图的示例 个人中心组织架构图调整为只显示本级及以上 详细更新情况: 【修复】移动端代码生成器bug修复 【修复】多标签鼠标右键关闭按钮出现"使用了错误的类型或对象"的问题(感谢”diant“送来的PR) 【优化】系统监控页面加载优化(感谢”diant“送来的PR) 【更新】修复业务模块下机构选择器树无法构造的bug,前端保持左树右表跟form表单各自统一 【新增】新增高德地图与百度地图的示例(感谢”这么诚实“送来的PR) 【新增】实现对话框拖拽功能(感谢”lingsoul“送来的PR) 【优化】主管name回显使用翻译插件代替ext_json 【优化】修复用户授权资源无法取消只有一个资源的问题 【优化】更新issues中提到的minio内配置提示语错误优化 【更新】优化人员、机构、职位、角色的前端代码,解决左侧树点击多次后无法折叠展开的情况 【更新】个人中心组织架构图调整为只显示本级及以上,同...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker容器配置,解决镜像无法拉取问题
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- 2048小游戏-低调大师作品
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- MySQL数据库在高并发下的优化方案
- Dcoker安装(在线仓库),最新的服务器搭配容器使用
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题