Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QLExpress 3.2.0 在执行一些简单得表达式性能有抖动,这有解吗? #328

Open
shenshihao520 opened this issue May 28, 2024 · 4 comments

Comments

@shenshihao520
Copy link

例如:
表达式:sumYTax >= 0 耗时:3
表达式:sumYTax >= 0 耗时:3
表达式:!personal 耗时:3
sumYTax 、personal 这些字段都是一些执行的上下文变量,一般来说这些简单的表达式不会超过1毫秒,但是经测试执行10000次,总有20、30次超过1毫秒的情况通常都在3-4毫秒。
使用缓存参数也是true

@taokan
Copy link
Contributor

taokan commented Jul 2, 2024

表达式耗时和机器的时间片调度,有没有受限等有关,每次内部的执行逻辑应该是一致的

@DQinYuan
Copy link
Collaborator

DQinYuan commented Jul 2, 2024

有代码用例吗?

@shenshihao520
Copy link
Author

代码很简单,就是声明了一个单例
private static ExpressRunner expressRunner;

public static ExpressRunner getQLRunnerInstance(){
if(null == expressRunner){
synchronized (QLOperator.class){
if(null == expressRunner){
init();
}
}
}
return expressRunner;
}
然后确实用了多线程调用这个方法
QLOperator.getQLRunnerInstance().execute(expressString, context, null, true, false);
但是我看cpu负载也不高啊,难道真的是因为机器的时间片调度?

@DQinYuan
Copy link
Collaborator

@shenshihao520 抖动是指刚启动的时候抖动?还是应用启动后稳定运行的时候,也会抖?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants