-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FrozenVector to wrap neighbors #317
base: master
Are you sure you want to change the base?
Add FrozenVector to wrap neighbors #317
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #317 +/- ##
==========================================
- Coverage 97.26% 97.23% -0.03%
==========================================
Files 115 116 +1
Lines 6795 6805 +10
==========================================
+ Hits 6609 6617 +8
- Misses 186 188 +2 ☔ View full report in Codecov by Sentry. |
We could wait until #315 is merged to have a proper benchmarking pipeline? |
That one has been merged now. |
It has been merged to a branch of the main repo ( Besides performance issues, I am personally opposed to this change, because the additional wrapper might be confusing for users (what is this |
Right, I had just looked at the
Nowhere do we guarantee that we run an
And And I don't think performance should be affected seriously. |
Futhermore, if someone is actually confused what a |
Okay, I'm convinced that the benefits outweigh the costs on the correctness side. Can you maybe run some benchmarks locally, say Dijkstra on a large enough graph, to see if there is a big performance hit from creating the wrappers every time? Maybe even |
I will probably merge to master before the community call. After you can use that for benchmarks and talk further. |
Awesome, thank you so much! Don't hesitate to ask for a review beforehand though, to follow ColPrac |
8286e57
to
43b3ad0
Compare
This PR makes the output of
neighbors
,inneighbors
andoutneighbors
immutable by wrapping the returnedVector
in an immutable wrapper calledFrozenVector
.I noticed that the generated machine code for
Base.getindex
is slightly different (one additional instruction) withFrozenVector
compared to the previously usedVector
- this does probably not have a significant performance impact, but I should run some benchmarks.See also this issue: #316