You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2017/06/09 18:23:21 UTC

[jira] [Commented] (SPARK-21038) Reduce redundant generated init code in Catalyst codegen

    [ https://issues.apache.org/jira/browse/SPARK-21038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044810#comment-16044810 ] 

Sean Owen commented on SPARK-21038:
-----------------------------------

I double-checked, and yes you're right that initializing a field to its default value still generates bytecode that isn't generated if you just let it default.

> Reduce redundant generated init code in Catalyst codegen
> --------------------------------------------------------
>
>                 Key: SPARK-21038
>                 URL: https://issues.apache.org/jira/browse/SPARK-21038
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Kris Mok
>            Priority: Minor
>
> In Java, instance fields are guaranteed to be first initialized to their corresponding default values (zero values) before the constructor is invoked. Thus, explicitly code to initialize fields to their zero values is redundant and should be avoided.
> It's usually harmless to have such code in hand-written constructors, but in the case of mechanically generating code, such code could contribute to a significant portion of the code size and cause issues.
> This ticket is a step in reducing the likelihood of hitting the 64KB bytecode method size limit in the Java Class files. The proposal is to use some simple heuristics to filter out redundant code of initializing mutable state to their default (zero) values in CodegenContext.addMutableState. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org