Skip to content

docs: the allocating operations' cost, measured and split - #72

Merged
tannevaled merged 1 commit into
mainfrom
docs/allocation-cost
Oct 26, 2026
Merged

tannevaled merged 1 commit into
mainfrom
docs/allocation-cost

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Docs only. This replaces the vague "open defect" paragraph about the allocating operations with a measured breakdown (float64 Add, 2¹⁴, one POWER9 core):

time
AddInto (the kernel) 5.7 µs
Add, GOGC=off 13.5–15.0 µs (+8 µs: fresh memory faulted in and zeroed)
Add, GOGC=400 15.7 µs
Add, default GC 23.5 µs (+9 µs of GC cycles)
NumPy a+b 8.48 µs

Neither part is the library's to remove. Go zeroes every allocation, and the GC's pace belongs to the program. The benchmark's tiny live heap is the worst case. The paragraph names the remedies: *Into or Workspace to reuse buffers, and GOGC/GOMEMLIMIT to tune the GC. A scavenger setting (madvdontneed=0) changed little and is left out.

No code change, so no release. The docs site picks it up at the next release.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 42b31ee into main Oct 26, 2026
12 checks passed
@tannevaled
tannevaled deleted the docs/allocation-cost branch October 26, 2026 16:17
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.

1 participant