Skip to content

make nn non-allocating by having it "track" scalars#228

Merged
KristofferC merged 1 commit into
masterfrom
kc/nn_alloc
Nov 20, 2025
Merged

make nn non-allocating by having it "track" scalars#228
KristofferC merged 1 commit into
masterfrom
kc/nn_alloc

Conversation

@KristofferC

Copy link
Copy Markdown
Owner

Fixes #227

From the benchmark in that issue:

# Before
julia> @btime nn($tree, $p)
  52.347 ns (4 allocations: 128 bytes)
(19, 0.14043712730996852)

# After
julia> @btime nn($tree, $p)
  29.732 ns (0 allocations: 0 bytes)
(19, 0.14043712730996852)

@KristofferC KristofferC merged commit 1e8a0ea into master Nov 20, 2025
9 checks passed
@KristofferC KristofferC mentioned this pull request Apr 17, 2026
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.

nn on a single point uses allocations

1 participant