Skip to content

Commit

Permalink
[routing] Routing performance optimization. Stop checking twin featur…
Browse files Browse the repository at this point in the history
…es geometry on the same mwm versions.
  • Loading branch information
bykoianko authored and mesozoic-drones committed Oct 21, 2020
1 parent 3eb7fe7 commit bf726d5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions routing/cross_mwm_index_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,24 @@ class CrossMwmIndexGraph final

CHECK_NOT_EQUAL(twinSeg->GetMwmId(), s.GetMwmId(), ());

// Checks twins for equality.
// Checks twins for equality if they are from different mwm versions.
// There are same in common, but in case of different version of mwms
// their's geometry can differ from each other. Because of this we can not
// build the route, because we fail in astar_algorithm.hpp CHECK(invariant) sometimes.
if (SegmentsAreEqualByGeometry(s, *twinSeg))
auto const & sMwmId = m_dataSource.GetMwmIdByCountryFile(m_numMwmIds->GetFile(s.GetMwmId()));
CHECK(sMwmId.IsAlive(), (s));
auto const & twinSegMwmId =
m_dataSource.GetMwmIdByCountryFile(m_numMwmIds->GetFile(twinSeg->GetMwmId()));
CHECK(twinSegMwmId.IsAlive(), (*twinSeg));
if (sMwmId.GetInfo()->GetVersion() == twinSegMwmId.GetInfo()->GetVersion() ||
SegmentsAreEqualByGeometry(s, *twinSeg))
{
twins.push_back(*twinSeg);
}
else
{
LOG(LINFO, ("Bad cross mwm feature, differ in geometry. Current:", s, ", twin:", *twinSeg));
}
}
}

Expand Down Expand Up @@ -206,7 +216,6 @@ class CrossMwmIndexGraph final
};

m_dataSource.ReadFeature(fillGeometry, featureId);

return geometry;
}

Expand Down

0 comments on commit bf726d5

Please sign in to comment.