perf: pack logical-type name lists (allocNames blob)#83
Merged
mlafeldt merged 2 commits intoMay 18, 2026
Conversation
Replace per-label C.CString in allocNames with a pointer array plus a contiguous NUL-terminated blob; drop duckdb_go_bindings_free_names. Add enum regression test and BenchmarkCreateEnumType_64Names.
This was referenced May 15, 2026
Contributor
Author
mlafeldt
reviewed
May 18, 2026
Member
mlafeldt
left a comment
There was a problem hiding this comment.
Thanks, arena-style allocation is the right call.
Just some minor cleanups left before we can merge this.
…per) - Remove duckdb_go_bindings_set_name (no longer used). - Always allocNames(columnNames); freeNameList is nil-safe for empty slice. - Rename loop length var L -> slen; index name slots with uintptr(charSize). - Remove unused benchMustOpen from PR1-only bench file.
adubovikov
added a commit
to adubovikov/duckdb-go-bindings
that referenced
this pull request
May 18, 2026
Same allocNames/AppenderCreateQuery/header adjustments as duckdb#83 follow-up.
Contributor
Author
|
Pushed |
Contributor
Author
Follow-up on review feedbackThanks for the review - updates are in
Checks: Let me know if anything else should be tweaked before merge. |
mlafeldt
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
C.CStringinallocNameswith one pointer array + one contiguous NUL-terminated blob (duckdb_malloc), andfreeNameListto release both.duckdb_go_bindings_free_namesfrominclude/duckdb_go_bindings.h(callers free the blob/array only).CreateUnionType,CreateStructType,CreateEnumType, hybridAppenderCreateQuery(column names only; query/table still useCStringuntil a follow-up PR), and ArrowNewArrowSchema.TestCreateEnumType_manyPackedNamesandBenchmarkCreateEnumType_64Names.This is PR 1 of 4 splitting the work from PR #82 as requested for easier review. After this merges, the next branches to rebase onto
upstream/mainand open as separate PRs are:adubovikov:perf/upstream-pr/2-hot-bind-paths— bind/blob/varchar/vector hot paths without pooladubovikov:perf/upstream-pr/3-nul-pool-core—withNULStringpool + Open/Query/Prepare pathsadubovikov:perf/upstream-pr/4-nul-pool-sweep— remainingCStringroutes through the poolOptional harness (after PR 1–4 land or separately):
adubovikov:perf/upstream-pr/5-cpu-bench-harness(cpu_bench/).Test plan
CGO_ENABLED=1 go test ./...CGO_ENABLED=1 go test -tags duckdb_arrow ./...