-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance in SqliteStorage::get_bagfile_size() (#1516)
* Improve performance in SqliteStorage::get_bagfile_size() - In SQLite3 DB file size is equal to the db page_count * page_size - Use DB query to get page_count and page_size instead of filesystem blocking call. Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address integration tests failure - Don't use static objects for the SqliteStatement, it causes DB lock and failure to close and open it again. Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Protect get_bagfile_size() with database_write_mutex_ Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Make get_bagfile_size() lock free to avoid locking double-buffer cache - Moved db_file_size_ update to the functions which are writing to the database Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Move test_storage_interfaces.cpp to the rosbag2_tests - Move test_storage_interfaces.cpp to the rosbag2_tests due to the cyclic dependencies between rosbag2_storage and storage plugins. Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Rename test_storage_interfaces.cpp to the test_rosbag2_storage_api.cpp Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address review comments - Rename `database_write_mutex_` to the `db_read_write_mutex_` - Add const qualifiers for get_page_size() and read_total_page_count_locked() methods Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Fix Windows warnings in test_rosbag2_storage_api.cpp Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
- Loading branch information
1 parent
73b0772
commit f3d62df
Showing
5 changed files
with
252 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,6 @@ if(BUILD_TESTING) | |
rosbag2_test_common::rosbag2_test_common | ||
yaml-cpp | ||
) | ||
endif() | ||
endif() | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.