use ArrayOfArrays for return value to reduce the number of allocated arrays#167
Open
KristofferC wants to merge 1 commit intomasterfrom
Open
use ArrayOfArrays for return value to reduce the number of allocated arrays#167KristofferC wants to merge 1 commit intomasterfrom
KristofferC wants to merge 1 commit intomasterfrom
Conversation
6d5edc2 to
cb71f4c
Compare
Owner
Author
|
@nanosoldier |
|
The package evaluation job you requested has completed - possible new issues were detected. |
1748083 to
92766f7
Compare
Closed
64944b1 to
f34aa27
Compare
…arrays A long standing gripe for me has been that indices and distances are returned as standard nested `Array`s. Typically, each inner array hold quite a small number of neighbors so it means that we allocate a large number of small arrays. Using ArrayOfArrays, these are stored contigously in one large flat array instead. The difference in allocations can be readily seen: ```julia julia> input = rand(3, 10^6); julia> tree = KDTree(rand(3, 10^6)); julia> @time knn(tree, input, 5); 1.538003 seconds (2.00 M allocations: 221.253 MiB, 10.03% gc time) julia> @time knn(tree, input, 5); 1.489310 seconds (98 allocations: 189.884 MiB, 0.29% gc time) ```
Owner
Author
|
@nanosoldier |
|
The package evaluation job you requested has completed - possible new issues were detected. Report summary✖ Packages that failed3 packages failed only on the current version.
40 packages failed on the previous version too. ✔ Packages that passed tests1 packages passed tests only on the current version.
59 packages passed tests on the previous version too. ➖ Packages that were skipped altogether19 packages were skipped on the previous version too. |
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.
A long standing gripe for me has been that indices and distances are returned as standard nested
Arrays. Typically, each inner array hold quite a small number of neighbors so it means that we allocate a large number of small arrays.Using ArrayOfArrays, these are stored contigously in one large flat array instead.
The difference in allocations can be readily seen: