Repository navigation
Conversation
|
Currently we do not store edge state inside the Weighting and I would like to keep it this way, except there is a huge benefit. What is the speed up in your measured cases? |
|
Hamburg(53.548416,10.003159) to Berlin(52.517997,13.396111) using flexible mode with a dummy custom model targeting 4 areas. Test 1: Areas which don't intersect any edges{
"priority": [
{
"if": "in_a",
"multiply_by": 0.0
},
{
"if": "in_b",
"multiply_by": 0.0
},
{
"if": "in_c",
"multiply_by": 0.0
},
{
"if": "in_d",
"multiply_by": 0.0
}
],
"areas": {
"a": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[
[ 14.31, 51.75 ],
[ 14.34, 51.75 ],
[ 14.34, 51.77 ],
[ 14.31, 51.77 ],
[ 14.31, 51.75 ]
]]
}
},
"b": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[
[ 14.31, 51.75 ],
[ 14.34, 51.75 ],
[ 14.34, 51.77 ],
[ 14.31, 51.77 ],
[ 14.31, 51.75 ]
]]
}
},
"c": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[
[ 14.31, 51.75 ],
[ 14.34, 51.75 ],
[ 14.34, 51.77 ],
[ 14.31, 51.77 ],
[ 14.31, 51.75 ]
]]
}
},
"d": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[
[ 14.31, 51.75 ],
[ 14.34, 51.75 ],
[ 14.34, 51.77 ],
[ 14.31, 51.77 ],
[ 14.31, 51.75 ]
]]
}
}
}
}Unpatched: 370ms Diff: -14.5% Test 2: Areas intersecting with edgesSame model except for the coordinates: Unpatched: 1280ms Diff: -20% |
|
Note that the second test should also be a lot faster with #2326 as we don't need to load any edge geometries to detect intersections. |
|
Under these circumstance I would not want to introduce this caching (yet). |
Should we cache the bbox in the EdgeIteratorState? That would also allow us to avoid PointList creation as we could use NodeAccess to create the BBox directly. |
|
Implemented bbox caching as part of the EdgeIteratorState: master...otbutz:iter_bbox The biggest benefit is that we're able to reuse the BBox instance for all visited edges. This completely avoids object creation and brings my second test case down to about 940ms which is a whooping 30% faster than our current master. |
|
Closing in favor of #2338 |
Solves the remaining
TODOby caching the edge bbox and way geometry for multiple areas.TODO: combine with #2321 to reset und update the cached bbox which would eliminate most object creation