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

NAVAND-1545: introduce long routes optimised mode #7564

Merged
merged 118 commits into from
Oct 27, 2023

Conversation

VysotskiVadim
Copy link
Contributor

@VysotskiVadim VysotskiVadim commented Oct 16, 2023

Description

This PR introduces a special model for long routes handling which is activated by LongRoutesOptimisationOptions. When it's active, the SDK changes behaviour to be able to handle heavy routes:

  1. NavigationRoute.directionsResonse.routes always returns an empty list, so that route objects of dropped alternatives could be removed from memory.
  2. Before parsing a long route, the SDK drops current alternatives to feee up memory
  3. Long routes are parsed in a queue. I.e. The SDK won't start parsing new route request until parsing of new alternative routes is finished.
  4. Navigation doesn't parse response of immediate route refresh as the same routes are later available in the regular alternatives callback.

Besides the optimised mode, there are a few optimisations which are always working:

  1. The SDK clears internal caches more aggressively.
  2. Navigation telemetry doesn't store original route

@github-actions
Copy link

github-actions bot commented Oct 16, 2023

Changelog

Features

  • Introduced NavigationOptions#longRoutesOptimisationOptions which changes the Nav SDK behavior so that it's able to handle heavy routes objects. See documentation of OptimiseNavigationForLongRoutes to learn more about it. [#7564](https://github.com/mapbox/mapbox-navigation-android/pull/7564)

Bug fixes and improvements

Known issues ⚠️

Other changes

Android Auto Changelog

Features

Bug fixes and improvements

  • The app is now considered as the one in active navigation only when an active route is set to MapboxNavigation. Previously it was always considered active. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)
  • When Android Auto host tells the app to stop active navigation because another app starts navigating, now SDK will enter FreeDrive mode instead of stopping trip session completely. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)

@VysotskiVadim VysotskiVadim requested a review from dzinad October 25, 2023 12:40
parsing: suspend (ParseArguments) -> T
): T {
return if (routeResponseInfo.sizeBytes < options.responseToParseSizeBytes) {
parsing(ParseArguments(optimiseDirectionsResponseStructure = true))
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like only some parts of the optimization is enabled in this case:

  1. You don't preclear alternatives (this part is disabled);
  2. You still remove routes from the Directions Response (this part is enabled).
    Is this true? If yes, is that what you wanted to achieve?

@VysotskiVadim VysotskiVadim added the needs backporting Requires cherry-picking to a currently running release branch label Oct 27, 2023
@VysotskiVadim VysotskiVadim merged commit 7e7e94c into main Oct 27, 2023
7 of 10 checks passed
@VysotskiVadim VysotskiVadim deleted the NAVAND-1545-prototyping-optimisation branch October 27, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backporting Requires cherry-picking to a currently running release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants