[ 
https://issues.apache.org/jira/browse/BEAM-9019?focusedWorklogId=366629&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-366629
 ]

ASF GitHub Bot logged work on BEAM-9019:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Jan/20 13:29
            Start Date: 06/Jan/20 13:29
    Worklog Time Spent: 10m 
      Work Description: echauchot commented on pull request #10461: [BEAM-9019] 
Remove BeamCoderWrapper to avoid extra object allocation
URL: https://github.com/apache/beam/pull/10461#discussion_r363291936
 
 

 ##########
 File path: 
runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/helpers/EncoderHelpers.java
 ##########
 @@ -234,30 +194,33 @@ public Expression child() {
 
     @Override
     public ExprCode doGenCode(CodegenContext ctx, ExprCode ev) {
-      String accessCode =
-          ctx.addReferenceObj(
-              "beamCoderWrapper", beamCoderWrapper, 
BeamCoderWrapper.class.getName());
+      String accessCode = ctx.addReferenceObj("coder", coder, 
coder.getClass().getName());
       ExprCode input = child.genCode(ctx);
       String javaType = CodeGenerator.javaType(dataType());
+
       List<String> parts = new ArrayList<>();
       List<Object> args = new ArrayList<>();
       /*
             CODE GENERATED:
-            final $javaType ${ev.value} = ($javaType) 
$beamCoderWrapper.decode(${input.isNull}, ${input.value});
+            final ${javaType} ${ev.value} = (${input.isNull})
 
 Review comment:
   This adds a little more generated code. Out of 4 runs, this PR seems to add 
from 0.1s to 0.2s to the queries. Maybe doing the ternary expression inside the 
compiled java code will be better.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 366629)
    Time Spent: 1h 50m  (was: 1h 40m)

> Improve Spark Encoders (wrappers of beam coders)
> ------------------------------------------------
>
>                 Key: BEAM-9019
>                 URL: https://issues.apache.org/jira/browse/BEAM-9019
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-spark
>            Reporter: Etienne Chauchot
>            Assignee: Etienne Chauchot
>            Priority: Major
>              Labels: structured-streaming
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> To improve maintenability and performance, replace as much as possible of 
> catalyst generated code with java compiled code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to