-
-
Notifications
You must be signed in to change notification settings - Fork 392
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 astar benchmark #2342
base: master
Are you sure you want to change the base?
add astar benchmark #2342
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2342 +/- ##
=======================================
Coverage 83.50% 83.50%
=======================================
Files 376 376
Lines 61549 61549
=======================================
Hits 51399 51399
Misses 10150 10150 Continue to review full report in Codecov by Sentry.
|
Even though this would be difficult for us to implement (without moving to C++), I wanted to mention that some systems store metadata for vectors that indicate the vector contents. For example, I think recent R versions keep track of whether a vector contains NA / NaN. Mathematica appears to do something similar (although strictly speaking it doesn't allow NaNs in vectors). This is much like the cache we use in If we did have this feature, it could speed up check. We could even set this cache when transferring vectors from R or Mathematica. But in plain C, there is no good way that I can think of to catch vector modification operations and clear this cache. So I don't think we can do it now. C++ would be different ... |
In some cases, the input checks can be moved into the core algorithm. This may be an advantage (when the algorithm accesses only a small fraction of edges and their weights) or a disadvantage (which the algorithm accesses the same edge / weight many times). |
part of #2300
Added some benchmarks for things that almost take no time, because they did take a significant amount of time with a debug build with sanitizers on.
So for the case where you path length is negligible:
just checking weights (vector_min) takes up almost all the time for the full graph.
error checking + filling the dists vector (which scales with no_of_nodes) takes about 8/9 of the time for the ring graph. I find it difficult to find where the rest of the time goes.
I've also put in the longest path scenario, then the overhead is less than 1/40.