Skip to content

Loading time optimization#1569

Merged
matlabbe merged 15 commits intomasterfrom
loading_time_optimization
Sep 3, 2025
Merged

Loading time optimization#1569
matlabbe merged 15 commits intomasterfrom
loading_time_optimization

Conversation

@matlabbe
Copy link
Member

@matlabbe matlabbe commented Aug 19, 2025

This PR is improving loading time of a database, by:

  • Avoiding rebuilding multiple times the FLANN index (based on rebalance factor) when we load all visual words at once.
  • New parameter called Kp/FlannIndexSaved can be used to save the FLANN index to the database. This implements the idea from this comment: Need for speed - Speed up loading map time #1267 (comment). It makes reloading the dictionary super fast. We added multiple checks in case the dictionary changed for any reasons (dictionary parameters changed, words have been added/removed incrementally to dictionary...). Also in contrast to Need for speed - Speed up loading map time #1267, we avoid saving again the descriptors. Currently this feature can be enabled only in localization mode.
  • New parameter called Mem/LoadVisualLocalFeaturesOnInit can be disabled to avoid loading all visual features in RAM on start. This saves significantly time to load database. The features are loaded on RAM only "on-demand", i.e., only when a loop closure transformation is required. One caveat is that it may make RGBD/LocalBundleOnLoopClosure not working properly.
  • On rtabmap_ros, we also already added a new parameter map_cache_loaded_on_init to rtabmap node (commit for ROS1 introlab/rtabmap_ros@ca4d331). Similarly to Mem/LoadVisualLocalFeaturesOnInit, if map_cache_loaded_on_init is false, we also don't load immediately all local grids in RAM. This saves time on initialization and when switching maps (load_database service). Note that in localization mode where the global optimized map doesn't change, it may also save significant RAM. However, as soon as the global occupancy grid needs to be updated/re-assembled, all local grids may be reloaded. So if we expect that the global occupancy grid will be re-optimized, it is better to keep the old behavior by loading all local grids in RAM at the beginning, to avoid big lag in the middle of operation.

matlabbe and others added 3 commits August 18, 2025 10:57
…mented some very verbose debug logs (should create a new level: UVERBOSE or UTRACE)
…t", "Mem/FlannIndexSaved", "Kp/SerializeWithChecksum".
@matlabbe matlabbe marked this pull request as ready for review August 21, 2025 01:37
@matlabbe matlabbe merged commit 4603f09 into master Sep 3, 2025
6 of 7 checks passed
@matlabbe matlabbe deleted the loading_time_optimization branch September 3, 2025 23:55
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.

1 participant