felipecrv commented on code in PR #34666:
URL: https://github.com/apache/arrow/pull/34666#discussion_r1145111994


##########
go/arrow/compute/vector_run_end_test.go:
##########
@@ -295,3 +299,125 @@ func TestRunEndFunctions(t *testing.T) {
                })
        }
 }
+
+func benchRunEndEncode(b *testing.B, sz int, nullProb float64, runEndType, 
valueType arrow.DataType) {
+       b.Run("encode", func(b *testing.B) {
+               var (
+                       mem = 
memory.NewCheckedAllocator(memory.DefaultAllocator)
+                       rng = gen.NewRandomArrayGenerator(seed, mem)
+               )
+
+               values := rng.ArrayOf(valueType.ID(), int64(sz), nullProb)
+               b.Cleanup(func() {
+                       values.Release()
+               })
+
+               var (
+                       res   compute.Datum
+                       err   error
+                       ctx   = compute.WithAllocator(context.Background(), mem)
+                       input = &compute.ArrayDatum{Value: values.Data()}
+                       opts  = compute.RunEndEncodeOptions{RunEndType: 
runEndType}
+
+                       byts int64
+               )
+
+               for _, buf := range values.Data().Buffers() {
+                       if buf != nil {
+                               byts += int64(buf.Len())
+                       }
+               }
+
+               b.SetBytes(byts)
+               b.ResetTimer()
+               for n := 0; n < b.N; n++ {
+                       res, err = compute.RunEndEncode(ctx, opts, input)

Review Comment:
   This will vary very widely depending on the size of the runs. Does the REE 
random generator pay attention to this? Meaning: does it generate a normal 
distribution of run-lengths?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to