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

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

                Author: ASF GitHub Bot
            Created on: 30/Apr/22 01:44
            Start Date: 30/Apr/22 01:44
    Worklog Time Spent: 10m 
      Work Description: damccorm commented on code in PR #17475:
URL: https://github.com/apache/beam/pull/17475#discussion_r862276118


##########
sdks/go/pkg/beam/core/runtime/exec/fn_arity.tmpl:
##########
@@ -30,7 +30,7 @@ import (
 func (n *invoker) initCall() {
        switch fn := n.fn.Fn.(type) {
 {{range $out := upto 5}}
-{{range $in := upto 9}}
+{{range $in := upto 10}}

Review Comment:
   Yeah, that's a good call - there was not a clear benefit to doing this. I 
tried the following benchmarks:
   
   ```
   func BenchmarkInvokeWith9Args_Call9x4(b *testing.B) {
        fn, _ := funcx.New(reflectx.MakeFunc9x4(func(a1 typex.EventTime, a2 
bool, a3 string, a4 int, a5 bool, a6 int, a7 string, a8 bool, a9 int) (int, 
bool, string, error) {
                return a4 + a6 + a9, a2 && a5 && a8, a3 + a7, nil
        }))
        args := []interface{}{mtime.ZeroTimestamp.Add(2 * time.Millisecond), 
true, "hello", 1, true, 3, "world", false, 4}
        f := fn.Fn.(reflectx.Func9x4)
        for n := 0; n < b.N; n++ {
                f.Call9x4(args[0], args[1], args[2], args[3], args[4], args[5], 
args[6], args[7], args[8])
        }
   }
   
   func BenchmarkInvokeWith9Args_Call(b *testing.B) {
        fn, _ := funcx.New(reflectx.MakeFunc(func(a1 typex.EventTime, a2 bool, 
a3 string, a4 int, a5 bool, a6 int, a7 string, a8 bool, a9 int) (int, bool, 
string, error) {
                return a4 + a6 + a9, a2 && a5 && a8, a3 + a7, nil
        }))
        args := []interface{}{mtime.ZeroTimestamp.Add(2 * time.Millisecond), 
true, "hello", 1, true, 3, "world", false, 4}
        f := fn.Fn
        for n := 0; n < b.N; n++ {
                f.Call(args)
        }
   }
   ```
   
   with the result:
   
   ```
   BenchmarkInvokeWith9Args_Call9x4-16            722283              1577 ns/op
   BenchmarkInvokeWith9Args_Call-16               805590              1447 ns/op
   ```
   
   So the normal call is actually more performant. It is probably worth 
revisiting this more systematically for lower arities as well, but I think that 
should fall outside the scope of this PR. For the moment, I've lowered it back 
down to 9





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

    Worklog Id:     (was: 764584)
    Time Spent: 10h 10m  (was: 10h)

> [Go SDK] Watermark Estimation
> -----------------------------
>
>                 Key: BEAM-11105
>                 URL: https://issues.apache.org/jira/browse/BEAM-11105
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-go
>            Reporter: Robert Burke
>            Assignee: Danny McCormick
>            Priority: P3
>          Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> Allow self checkpointing SplittableDoFns to specify a watermark estimator.
> (To be updated once [https://github.com/apache/beam/pull/13160] is merged and 
> the programming guide updated with SDF content.)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to