Comments (5)
看着不太可能,有计时代码吗?
from qlexpress.
看着不太可能,有计时代码吗?
ExpressRunner expressRunner = new ExpressRunner(true,false);
long begin=System.currentTimeMillis();
try{
Map map=new HashMap();
map.put("status","N");
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
context.putAll(map);
Object o = expressRunner.execute("status%9", context, null, true, false);
System.out.println(o);
}catch (Exception e){
//throw e;
}finally {
System.out.println(System.currentTimeMillis()-begin);
}
有的
from qlexpress.
public class PerformanceTest {
@Test
public void perfTest() throws Exception {
ExpressRunner expressRunner = new ExpressRunner(true,false);
long begin=System.currentTimeMillis();
try{
Map map=new HashMap();
map.put("status",10);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
context.putAll(map);
Object o = expressRunner.execute("status%9", context, null, true, false);
System.out.println(o);
} finally {
System.out.println(System.currentTimeMillis()-begin);
}
}
}
@bestpayAmes 我在自己机器上用单元测试测的, 7 ms, 如果有缓存, 肯定是在 1ms 以内
你那个 15s 的是不是在线上机器跑的, CPU 吃紧, 线程调度花了很多时间.
ExpressRunner 在线上一定要用成单例
from qlexpress.
map.put("status",10);
map.put("status","N");改成非数字就能复现;出现异常的情况第一次运行就会很慢;
from qlexpress.
@bestpayAmes 依旧是 9ms
from qlexpress.
Related Issues (20)
- 想了解下4.0版本 HOT 2
- 转义字符被吞得问题 HOT 1
- Stack Overflow (ExpressRunner.loadMultiExpress) HOT 1
- Stack Overflow (ExpressParse.parse) HOT 1
- 自定义不定参数函数基本类型不支持 HOT 2
- 不能 return 空? HOT 1
- 能否支持直接输入已解析好的规则表达式,不用ql表达式自己的解析能力 HOT 1
- 代码注释编译异常 HOT 4
- new ExpressRunner() 导致内存泄漏 HOT 4
- QL是否支持链式函数
- 脚本执行过程中跳跃/漏执行 HOT 1
- 多线程并发的时候命中缓存场景 HOT 1
- 属性中存在属性名alias和关键词冲突了,能否识别xx.alias这种情况 HOT 2
- ||运算符无法设置别名OR,不设置又提示找不到运算符 HOT 6
- 执行一段时间后 会报错java.lang.reflect.InvocationTargetException
- 如何返回业务错误信息,比如一个表达式里面好多规则,某些规则没命中返回提示信息
- 应该如何处理,主要是"{资本净额}*{核心资本}-{附属资本}"这个表达式它不支持,而我又要使用{}这个符号去进行计算 HOT 1
- 表达式语法检查错误,"OR(1<2, 2>3)" 语法检查正确,"or(1<2, 2>3)" 语法检查错误。
- 在3.2.3引入了不兼容的修改,不支持弱类型比较。 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qlexpress.