-
Notifications
You must be signed in to change notification settings - Fork 24
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
bidijkstra stall-on-demand #18
Comments
there is something missing: |
Yes the idea is not to expand nodes that are known to be settled even though they were not reached via the shortest path. I tried this here: 94c01eb but to my surprise I did not notice any speed up yet. Maybe I did something wrong. The first thing that should be checked (and I did not do this yet) is if the optimization reduces the number of settled nodes. If it does not something is wrong. If it does but the query speed is not improved I guess either the map is too small to benefit from stall on demand or already doing this simple check is too costly such that it is not worth it even though the number of settled nodes is reduced. |
but saving that the node was blocked before is not helpful in the future? |
I will try some things with the OSM-graph of germany. |
Whenever we pull a node from the heap it should either be expanded/settled or if it is blocked be discarded, but every node should be processed only once. If thats not the case this might be the/a problem (I thought that does not happen, but maybe I missed this)
Cool, thanks! |
okay in my case the number of visited nodes is always the same with/without stalling |
also i am not seeing any check for the node-level |
oh wait my implementation if not correct. I tried adapting it to my case. |
still the number of visited nodes is always the same |
Well thats good :) this means when we find out why there is still hope for improvements this way. |
my implementation: Stunkymonkey/osm_ch@ba94b4c |
i fixed my implementation and was getting a speedup: i will hopefully check your implementation later this evening |
Cool, can you check what happens if you leave out the |
the speedup for a single can be around 2.5, but also can be a little worse. I feel like local querys are slower, but querys with big distance are getting a better speedup. This is not verified yet, and just a feeling. I will check later if the rank has to be checked. |
Yes that matches my previous experience with this optimization
Yes that also makes sense |
If i leave it out no path is found |
#19 still no speedup 😒 |
I added a performance test for a larger map (California+Nevada) and some counters to see the number of polled nodes here: https://github.com/easbar/fast_paths/compare/stall_on_demand export RUST_TEST_THREADS=1; cargo test run_performance_test_time_cali --release -- --ignored --nocapture Running this with and without the stall-on-demand optimization I got: without the optimization
with the optimization
So the number of polls is reduced by about 30% and the average query time is reduced from 186 to 158µs (-15%) in this test. So not bad, but maybe also not what we were hoping for. |
Btw the Dimacs graphs can be found here: http://www.dis.uniroma1.it/~challenge9/, but unfortunately it seems they are no longer available (or at least right now not available) as they created a new website (?) |
Doing the same for the distance metric: export RUST_TEST_THREADS=1; cargo test run_performance_test_dist_cali --release -- --ignored --nocapture yields better results: without the optimization
with the optimization
The number of polls is reduced by about 55% and the query time goes down about 30%. |
I commited the stall on demand optimization to master here: d13c5e1 |
I am not sure if I understand stall-on-demand fully.
this one will improve query time for sure 😉
i have seen @easbar implemented it for
graphhopper
, so i guess you understood everything.please check my understanding:
the blocking happens before the neighboring nodes are added to the heap. Because adding nodes to the heap is the expensive part.
so we iterate over incoming edges with its neighbors and check if a node with a higher level is already settled. if so we end here.?
if not we iterate as usual over outgoing edges with its neighbors and add them to the heap.
do we have to store something when a node is blocked?
The text was updated successfully, but these errors were encountered: