You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An IllegalStateException is thrown every time I try to calculate a path more than once because I can't call the clear() method since it no longer exists.
An algorithm could be re-used until this commit. Reusing caused some problems in the past, so just create a new instance to avoid this, see the new RoutingAlgorithmFactory. E.g. calling clear for trove maps is slow compared to recreation as it needs to fill arrays with zeros. Also in a server environment you would have to take great care to use one instance per thread only (with the clear method).
Especially with the introduced possibility to use an algorithm instance for different vehicle types it is important to avoid a wrong configuration of an algorithm.
This approach isn't that memory efficient and will be probably improved at a later time. Let me know if you have memory problems due to that change.
I'm reopening this here as it should get fixed somehow. At least testing this out in a production environment with a speed test and comparing re-usage vs. creating new ones
I've introduced a new dijkstra class which is more efficient when doing lots of queries of the same type and weight and starting point like it is done in the preparation process for contraction hierarchies. It completely avoids a map but requires to allocate some arrays for ALL nodes in the graph.
For the other algorithms: just reusing (via calling clear) leads to even slower responds times (compared to creating new objects). Some minor improvements can be made when allocating the new objects (heap and map) with the same size of the older ones, but this depends a lot on path length of previous request and is at the moment not worth the effort. (+only worth for none-CH queries)
Activity
karussell commentedon Mar 1, 2013
An algorithm could be re-used until this commit. Reusing caused some problems in the past, so just create a new instance to avoid this, see the new RoutingAlgorithmFactory. E.g. calling clear for trove maps is slow compared to recreation as it needs to fill arrays with zeros. Also in a server environment you would have to take great care to use one instance per thread only (with the clear method).
Especially with the introduced possibility to use an algorithm instance for different vehicle types it is important to avoid a wrong configuration of an algorithm.
This approach isn't that memory efficient and will be probably improved at a later time. Let me know if you have memory problems due to that change.
karussell commentedon Apr 22, 2013
I'm reopening this here as it should get fixed somehow. At least testing this out in a production environment with a speed test and comparing re-usage vs. creating new ones
karussell commentedon May 7, 2013
I've introduced a new dijkstra class which is more efficient when doing lots of queries of the same type and weight and starting point like it is done in the preparation process for contraction hierarchies. It completely avoids a map but requires to allocate some arrays for ALL nodes in the graph.
For the other algorithms: just reusing (via calling clear) leads to even slower responds times (compared to creating new objects). Some minor improvements can be made when allocating the new objects (heap and map) with the same size of the older ones, but this depends a lot on path length of previous request and is at the moment not worth the effort. (+only worth for none-CH queries)
Merge pull request graphhopper#18 from tyrasd/patch-1
Fixes issue #18.
Add alternative Routes to Navigation Endpoint (#18)
Merge of navigation repository (#2071)