Closed tomaszrybakiewicz closed 3 months ago
Attention: Patch coverage is 88.88889%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 74.17%. Comparing base (
ef828e6
) to head (1901e79
).
@@ Coverage Diff @@
## main #7833 +/- ##
=========================================
Coverage 74.16% 74.17%
+ Complexity 6265 6262 -3
=========================================
Files 856 856
Lines 33779 33789 +10
Branches 4023 4023
=========================================
+ Hits 25053 25062 +9
- Misses 7168 7170 +2
+ Partials 1558 1557 -1
Files | Coverage Δ | |
---|---|---|
...gation/ui/voice/api/VoiceInstructionsTextPlayer.kt | 82.02% <88.88%> (+1.00%) |
:arrow_up: |
Issue
NAVAND-2991
Description
Backporting v3 optimization https://github.com/mapbox/navigation/pull/5638
NavSDK 2.0 traces captured from "examples > Voice Example" activity running on Android Emulator.
TextToSpeechProvider.getTextToSpeech(...)
21ms
30ms
VoiceInstructionsTextPlayer.initializeWithLanguage(...)
207ms
508ms
textToSpeech.speak(...)
25ms
1ms
15ms
1ms
I've moved both
initializeWithLanguage(...)
andtextToSpeech.speak(...)
calls to the background thread to optimize this. Additionally, I've updated the "examples > Voice Example" activity to initializeMapboxVoiceInstructionsPlayer
off the main thread. The optimized execution time slightly increased due to lesser background thread prioritization.navsdk-cpu-perfetto.baseline.trace.zip navsdk-cpu-perfetto.optimized.trace.zip