lidavidm commented on issue #2021:
URL: https://github.com/apache/arrow-adbc/issues/2021#issuecomment-2235744377

   I eventually bisected this to a change in the Go compiler: 
https://github.com/golang/go/commit/3560cf0afb
   
   @zeroshade believes it may be mallocator, but a pure-Go reproducer does not 
exhibit any problems:
   
   ```
   lidavidm@debian ~/C/a/g/adbc ((adfb70a2)) [1]> go test -v 
./driver/flightsql/... -bench=. -run=nonexistent -benchtime 5s                  
                                          (adbc-go) 
   goos: linux
   goarch: amd64
   pkg: github.com/apache/arrow-adbc/go/adbc/driver/flightsql
   cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
   BenchmarkDefaultAllocator
   BenchmarkDefaultAllocator-16             4518           1195807 ns/op
   BenchmarkMallocator
   BenchmarkMallocator-16                   4952           1237689 ns/op
   PASS
   ok   github.com/apache/arrow-adbc/go/adbc/driver/flightsql   16.428s
   ?    github.com/apache/arrow-adbc/go/adbc/driver/flightsql/cmd/testserver    
[no test files]
   ```
   
   <details>
   <summary>Attempt at reproduction in Go</summary>
   
   ```go
   package flightsql
   
   import (
        "context"
        "testing"
   
        "github.com/apache/arrow/go/v16/arrow/memory"
        "github.com/apache/arrow/go/v16/arrow/memory/mallocator"
   )
   
   func BenchmarkDefaultAllocator(b *testing.B) {
        DoBenchmark(b, memory.DefaultAllocator)
   }
   
   func BenchmarkMallocator(b *testing.B) {
        DoBenchmark(b, mallocator.NewMallocator())
   }
   
   func DoBenchmark(b *testing.B, alloc memory.Allocator) {
        for i := 0; i < b.N; i++ {
                func() {
                        driver := NewDriver(alloc)
                        db, err := driver.NewDatabase(map[string]string{"uri": 
"grpc://localhost:8080"})
                        if err != nil {
                                b.Fatal(err)
                        }
                        defer db.Close()
                        cnxn, err := db.Open(context.Background())
                        if err != nil {
                                b.Fatal(err)
                        }
                        stmt, err := cnxn.NewStatement()
                        if err != nil {
                                b.Fatal(err)
                        }
                        defer stmt.Close()
                        if err = stmt.SetSqlQuery("SELECT 1"); err != nil {
                                b.Fatal(err)
                        }
   
                        reader, _, err := 
stmt.ExecuteQuery(context.Background())
                        if err != nil {
                                b.Fatal(err)
                        }
                        reader.Release()
                }()
        }
   }
   ```
   
   </details>


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