Skip to content
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

Optimise path distance calculation in MLD map matching #6876

Merged
merged 7 commits into from
May 11, 2024

Conversation

SiarheiFedartsou
Copy link
Member

@SiarheiFedartsou SiarheiFedartsou commented May 10, 2024

Issue

Benchmark

I used this benchmark - it is the best what we have now :)

Before

Screenshot 2024-05-10 at 20 18 24

After

Screenshot 2024-05-10 at 20 19 27

Tasklist

Requirements / Relations

Link any requirements here. Other pull requests this PR is based on?

@SiarheiFedartsou SiarheiFedartsou force-pushed the sf-optimise-map-matching branch from 9456fb3 to 25019cf Compare May 10, 2024 18:54
@@ -650,11 +650,38 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
return std::numeric_limits<double>::max();
}

std::vector<PathData> unpacked_path;
BOOST_ASSERT(unpacked_nodes.size() >= 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we could do similar optimisation for CH, but let's go step by step...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, there are two changes?

  1. Remove unnecessary annotations irrelevant to distance calculation.
  2. Use pre-calculated distances

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we can make much deeper optimization here: use 1 to N routing algorithm in map matching instead of running getNetworkDistance N times, but let's go with small steps...

@SiarheiFedartsou SiarheiFedartsou marked this pull request as ready for review May 10, 2024 19:35
Copy link
Member

@mjjbell mjjbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor suggestion.

@@ -650,11 +650,38 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
return std::numeric_limits<double>::max();
}

std::vector<PathData> unpacked_path;
BOOST_ASSERT(unpacked_nodes.size() >= 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, there are two changes?

  1. Remove unnecessary annotations irrelevant to distance calculation.
  2. Use pre-calculated distances

@SiarheiFedartsou SiarheiFedartsou merged commit ee8e0f8 into master May 11, 2024
20 checks passed
@SiarheiFedartsou SiarheiFedartsou deleted the sf-optimise-map-matching branch May 11, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants