Skip to content

perf: reduce ArrowBuffer builder reallocation work#330

Merged
CurtHagenlocher merged 1 commit intoapache:mainfrom
InCerryGit:perf/buffer-builder-append-range
Apr 25, 2026
Merged

perf: reduce ArrowBuffer builder reallocation work#330
CurtHagenlocher merged 1 commit intoapache:mainfrom
InCerryGit:perf/buffer-builder-append-range

Conversation

@InCerryGit
Copy link
Copy Markdown
Contributor

Summary

  • Pre-reserve ArrowBuffer.Builder<T> capacity when AppendRange receives a known-count collection.
  • Copy only the populated Length * sizeof(T) portion when reallocating builder storage.
  • Add focused coverage for enumerable, read-only collection, and reallocation preservation paths.

The reallocation behavior preserves appended/current-length contents. Capacity beyond Length remains undefined and is not copied across reallocations.

Validation

  • dotnet test test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj -c Release --filter "FullyQualifiedName~Apache.Arrow.Tests.ArrowBufferBuilderTests"
  • rtk dotnet build "Apache.Arrow.sln" -c Release
  • LSP diagnostics clean on changed files
  • Code review completed before commit; no blockers found

Copy link
Copy Markdown
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@CurtHagenlocher CurtHagenlocher merged commit 67b6db9 into apache:main Apr 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants