Repository navigation
docs: float64 Exp on 16 cores is slowed by allocation, not the kernel - #102
Merged
Merged
Conversation
The README listed float64 Exp below 256 Ki as 0.82x NumPy (16 cores). On one core it is 1.2-1.3x faster at every size. With GOMAXPROCS=16 the same serial code got slower than with 1 (89 vs 73 us at 16 Ki), as does Add (14 -> 23-26 us) while AddInto does not move: the per-result allocation costs more with more Ps. In a Workspace on 16 cores, Exp is 1.3-1.5x NumPy up to 16 Ki and 7-17x from 256 Ki (new BenchmarkExpWS). The README now says so; perf.md gets the table, and its note on the other architectures now reflects that the kernels live in go-simd/floats since v0.37.0, NEON included (unbenchmarked). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The README said float64
Expbelow 256 Ki was slower than NumPy (0.82×, measured with 16 cores). Measured today on Zen 3, that is the allocation, notExp. This PR corrects the claim and adds the benchmark that shows it.The evidence:
Expis 1.2–1.3× faster than NumPy at every size (1 Ki to 4 Mi).ParThreshold, nothing is split) gets slower than with 1, at 89 µs against 73 at 16 Ki.Addgoes from 14 to 23–26 µs at 16 Ps, whileAddInto, which allocates nothing, stays at 4.3 µs. The per-result allocation costs more with more Ps.Workspace(newBenchmarkExpWS), the difference disappears.Exp, Zen 3, load ≤ 5WorkspaceChanges:
Expmoves under "faster". The "slower" list keeps the allocating forms, noting that their cost grows with GOMAXPROCS.BenchmarkExpWS.No library code changes.
🤖 Generated with Claude Code