One shared handle should scale with threads like N separate handles do.
Today (docs/reference/bindings-v1.md §3): calls on one compiled handle are safe to run concurrently, but they contend inside the library. A handle per thread is the documented way to get the full parallel speed-up.
Measured: go v1.0.2 Schema.Rows at 8 goroutines (full tables on #456).
|
arm64 (Neoverse-V2) |
amd64 (Xeon 8375C) |
| one shared handle |
2.82× |
6.08× |
| own handle per goroutine |
6.90× |
6.79× |
The artifact producer measured the same arm-vs-x86 shape library-side. The cause is contention on the shared schema's column objects in the row path: atomic refcounts on shared columns.
The ask: one shared handle scales close to N handles, so a consumer need not keep a schema per thread. One direction: a per-thread working copy of the per-call block instead of shared column references.
Also: docs/reference/bindings-v1.md §3 quotes "about 4× to 6.5×" for a handle shared by 8 threads. The arm64 Go figure above is below that range, so §3 is to be corrected once this is resolved or re-measured.
Needs a library change from the artifact producer.
🤖 Generated with Claude Code
One shared handle should scale with threads like N separate handles do.
Today (
docs/reference/bindings-v1.md§3): calls on one compiled handle are safe to run concurrently, but they contend inside the library. A handle per thread is the documented way to get the full parallel speed-up.Measured: go v1.0.2
Schema.Rowsat 8 goroutines (full tables on #456).The artifact producer measured the same arm-vs-x86 shape library-side. The cause is contention on the shared schema's column objects in the row path: atomic refcounts on shared columns.
The ask: one shared handle scales close to N handles, so a consumer need not keep a schema per thread. One direction: a per-thread working copy of the per-call block instead of shared column references.
Also:
docs/reference/bindings-v1.md§3 quotes "about 4× to 6.5×" for a handle shared by 8 threads. The arm64 Go figure above is below that range, so §3 is to be corrected once this is resolved or re-measured.Needs a library change from the artifact producer.
🤖 Generated with Claude Code