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

[feat]利用scala AnyVal 值对象来优化 DataX #219

Open
baisui1981 opened this issue May 4, 2023 · 0 comments
Open

[feat]利用scala AnyVal 值对象来优化 DataX #219

baisui1981 opened this issue May 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@baisui1981
Copy link
Member

期望利用scala AnyVal(值对象)可以优化在CommonRdbmsReader中迭代ResultSet对象中的记存放到Record中,不需要每次为特定col类型生成专门的值对象,从而可以大大减轻VM垃圾回收的工作量以提高执行效率。

代码已经提交在 https://github.com/qlangtech/DataX/tree/scala ,不过从试验效率来看并没有创建值对象的步骤:
通过javap反编译scala代码 https://github.com/qlangtech/DataX/blob/scala/plugin-rdbms-util/src/main/scala/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.scala

   666: dup
     667: aload         12
     669: invokespecial #90                 // Method com/alibaba/datax/common/scala/element/StringColumn."<init>":(Ljava/lang/String;)V
     672: invokeinterface #96,  2           // InterfaceMethod com/alibaba/datax/common/scala/element/Record.addColumn:(Lcom/alibaba/datax/common/scala/element/Column;)V
     677: iload         10
     679: iconst_1

还是会去创建StringColumn对象,不知道是因为什么,有待进一步研究

@baisui1981 baisui1981 added this to the v3.8.0 milestone May 4, 2023
@baisui1981 baisui1981 added the enhancement New feature or request label May 4, 2023
@baisui1981 baisui1981 modified the milestones: v3.8.0, v4.0.0 Jul 16, 2023
@baisui1981 baisui1981 modified the milestone: v4.0.0 Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant