yuyong created IOTDB-6349:
-----------------------------

             Summary: FreeMarker Code Generation Filter
                 Key: IOTDB-6349
                 URL: https://issues.apache.org/jira/browse/IOTDB-6349
             Project: Apache IoTDB
          Issue Type: Improvement
          Components: Core/Query
            Reporter: yuyong


使用 FreeMarker 模板生成代码替换原本使用泛型的 Filter,避免重复装箱开销。
h3. 优化率

 
||数据类型||优化率||
|*boolean*| *3.814%*|
||int||5.577%||
||long||4.854%||
||float||5.483%||
||double||5.789%||
| *Binary*|*-0.259%*|

 
h3. 测试方法

在本地准备两个 IoTDB,一个使用提交号 
[fb1ce11|https://github.com/apache/iotdb/commit/fb1ce11c04f9278f86a2e984e2508d8c3c121a1f]
 
的提交的代码编译作为优化后的版本,一个使用提交号为[3369da8|https://github.com/apache/iotdb/commit/3369da8f29c437ea00aaad689dea7a50a791665a]
 的代码编译作为优化前的版本,打开 conf 目录下的 iotdb-system.properties文件添加时间戳精度为 ns:
{code:java}
# 打开配置文件
vim conf/iotdb-system.properties
# 在文件末尾添加时间戳精度为ns
timestamp=ns{code}
分别向优化前后的IoTDB中插入数据,导入20,000,000 行数据的 TsFile。
{code:java}
# 启动IoTDB 1C1D
sbin/start-standalone.sh
sbin/start-cli.sh{code}
{code:java}
# 在 IoTDB-Cli 中运行
load 'aligned.tsfile' onSuccess=none
# 关闭 Cli
exit{code}
{code:java}
# 关闭数据库
sbin/stop-standalone.sh{code}
开启优化前或优化后的 IoTDB,运行 jar 包,并记录运行时间。
{code:java}
# -DSQL查询语句为必填项 -DHOST 默认为 127.0.0.1 -DPORT 默认为6667
java -jar -DHOST=xxx -DPORT=xxx -DSQL=xxx compare.jar{code}
所执行查询 SQL 如下
{code:java}
# boolean类型
select count(status) from root.ln.wf01.wt01 where status = true
# int类型
select count(restartTime) from root.ln.wf01.wt01 where restartTime > 1005244491
# long类型
select count(runTime) from root.ln.wf01.wt01 where runTime > 4500095666825966708
# float类型
select count(code) from root.ln.wf01.wt01 where code > 47.39
# double类型
select count(temperature) from root.ln.wf01.wt01 where temperature > 50.23
# Binary类型
select count(log) from root.ln.wf01.wt01 where log > '549860'{code}
记录运行时间。

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to