当前位置:网站首页>Summary of actual business optimization scheme - main directory - continuous update
Summary of actual business optimization scheme - main directory - continuous update
2022-04-23 18:36:00 【Yin Zhen GRD_ Zhipeng】
Summarize the interesting problems encountered in the work , And corresponding solutions . Encountered a record .
The business is big , There are often inexplicable problems . For example, good plug-ins , Somehow it doesn't work . You cannot change the business code at this time , Or modify a little , We have to solve the problem .
List of articles
One 、Mybatis Climb a pit
1. mybatis-plus Auto fill failure 、 The paging plug-in does not pass down the interception chain
The question is shown in the title ,mybatis Auto fill does not take effect , Using the paging plug-in, it is found that the plug-in does not pass down the interception chain .
Solution
- Choose to use Mybatis-plus Pagination plug-in for , Meet the requirements of passing down the interception chain .
- imitation MyBatis-plus Auto fill using , Custom auto fill plug-in . solve Mybatis-plus Auto fill is sometimes valid and sometimes invalid .
For reasons of length , Put it in this article :https://blog.csdn.net/grd_java/article/details/124349094 |
---|
2. Use Spring AOP monitor mapper execution time
The company lets you optimize the query of the report ( A query is said to be close to 20s, An interface 15 Seconds will time out , So the worst thing is to let the query in 15s within ), These reports have a large amount of data ,IO A lot , A query involves dozens of sql and IO
So you want to optimize , You have to know which operations are more time-consuming , Direct use AOP It's a good choice , Print every... Accurately IO Time for , To optimize
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import java.util.Arrays;
/** * 2022-04-14===>>>yinzhipeng * Used to get mapper execution time */
@Component
@Aspect
@Slf4j
public class MapperExecutionTimeAspect {
@Pointcut("execution(* cn.xxx.mapper.*.*(..))")
public void pointcut() {
}
@Around("pointcut()")
public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
long begin = System.nanoTime();
Object obj = pjp.proceed();
long end = System.nanoTime();
log.info(" call Mapper Method : Execution time consuming :{} nanosecond , Time consuming :{} millisecond ,{}, Parameters :{}",
(end - begin), (end - begin) / 1000000,
pjp.getSignature().toString(), Arrays.toString(pjp.getArgs()));
return obj;
}
}
Two 、 Query optimization
1. A lot of mapper IO Optimize
When querying large reports , also sql Without much optimization space , How to improve efficiency ?
- That is to say, now IO Too much , But there's no way , Business really needs so much IO
- Single IO Efficiency optimization of , There is not much room for optimization , That is, optimize sql Our plan is not desirable
- So the question is how to make these IO Can you hurry up
In general, this is the case , You can consider multithreading , And large reports generally do not need to consider high concurrency . So write everything directly into the method , Not defined in a class , There's no thread safety issue . Because there is no high concurrency , There is no need to consider the problem of stack overflow ( Each thread execution will have a , Thread private , Life cycle is the same as thread , yes Java The thread memory model of method execution , When each method is executed ,Java All virtual machines will create a stack frame synchronously (Stack Frame) Used to store local variables 、 The stack of operands 、 Dynamic connection 、 Method exit information )
For reasons of length , Put it in this article :https://blog.csdn.net/grd_java/article/details/124348962 |
---|
版权声明
本文为[Yin Zhen GRD_ Zhipeng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231833296538.html
边栏推荐
- 多功能工具箱微信小程序源码
- Database computer experiment 4 (data integrity and stored procedure)
- With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
- ESP32 LVGL8. 1 - anim animation (anim 16)
- Use of regular expressions in QT
- QT curve / oscilloscope customplot control
- iptables -L执行缓慢
- Halo open source project learning (VII): caching mechanism
- Daily CISSP certification common mistakes (April 14, 2022)
- 特征选择feature_selection--SelectKBest
猜你喜欢
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
ctfshow-web362(SSTI)
Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système
QT reading and writing XML files (including source code + comments)
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
ctfshow-web361(SSTI)
[mathematical modeling] - analytic hierarchy process (AHP)
Cygwin64 right click to add menu, and open cygwin64 here
Matlab tips (6) comparison of seven filtering methods
随机推荐
Multifunctional toolbox wechat applet source code
ctfshow-web362(SSTI)
iptables初探
Introduction to quantexa CDI syneo platform
Connection mode of QT signal and slot connect() and the return value of emit
Imx6 debugging LVDS screen technical notes
回路-通路
os_authent_prefix
Ctfshow - web362 (ssti)
According to the result set queried by SQL statement, it is encapsulated as JSON
Interpretation and compilation of JVM
CISSP certified daily knowledge points (April 13, 2022)
WIN1 remote "this may be due to credssp encryption Oracle correction" solution
STM32学习记录0008——GPIO那些事1
Daily network security certification test questions (April 12, 2022)
With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
K210串口通信
Install the yapiupload plug-in in idea and upload the API interface to the Yapi document
Resolves the interface method that allows annotation requests to be written in postman
In win10 system, all programs run as administrator by default